Uiimageview更改图像会导致重新定位

时间:2013-05-23 22:48:25

标签: ios objective-c uiimageview uiimage

我可以修改uiimageview(动画)的位置并且它可以工作,但是当完成时我改变了这个uiimageview的图像然后它会在位置变化之前回到他的初始

CODE(工作但在完成时更改图像时重新定位uiimage。如果我不更改它们,它会完美运行并且图像保持在新位置。)

[UIView animateWithDuration:0.6 animations:^{
         CGRect frameLeft = singleIMG.frame;
         frameLeft.origin.x-=90;
         singleIMG.frame = frameLeft;
         frameLeft = singleTXT.frame;
         frameLeft.origin.x-=90;
         singleTXT.frame = frameLeft;
         frameLeft = pathIMG.frame;
         frameLeft.origin.x-=90;
         pathIMG.frame = frameLeft;
         frameLeft = pathTXT.frame;
         frameLeft.origin.x-=90;
         pathTXT.frame = frameLeft;

     } completion:^(BOOL finished){
         singleIMG.image = [UIImage imageNamed:@"singleGRAY.png"];
         pathIMG.image = [UIImage imageNamed:@"pathBLUE.png"];
     }];

0 个答案:

没有答案