如何在iphone动画中获取图像视图的当前位置

时间:2012-10-22 13:07:17

标签: iphone

  

可能重复:
  How to get UIView frame origin and size while animation

 -(void)anothertarget1
{


    UIImage *uranus=[UIImage imageNamed:@"red-ball1.png"];


    imagev=[[UIImageView alloc]initWithFrame:CGRectMake(5, 10, 100, 100)];
    imagev.alpha=0.6;
    imagev.image=uranus;

    [self.view addSubview:imagev];




    CGPoint goal = CGPointMake(self.view.center.x+70,self.view.center.y+24);

    CGPoint center=imagev.center;
    NSLog(@"center=%f",center);



    UIViewAnimationOptions opt = UIViewAnimationOptionAllowUserInteraction;
    [UIView animateWithDuration:20 delay:0 options:opt animations:^{
        //forimageview1;
        imagev.center = goal;


    } completion:^(BOOL f) {
        imagev.hidden=YES;

    }];

}

我想制作一个在动画中获取UIImageview当前位置的对象 请帮帮我

1 个答案:

答案 0 :(得分:0)

尝试使用CADisplayLink来更新显示。