2012-10-22 26 views
0

可能重复:
How to get UIView frame origin and size while animation如何让图像视图的当前位置动画期间在iphone

-(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当前位置动画中 请帮我

回答

0

试试使用CADisplayLink来更新显示比例。

相关问题