在iPad中单击按钮时,需要调整两个视图的大小。 我用以下代码试了一下
[UIView animateWithDuration:1.0 animations:^{
//Target Rect of the View will be given here
}];
它适用于iPad4.2,但崩溃与3.2版本(不兼容)。 在谷歌搜索发现3.2版本仅支持动画视图(W / O块) 资源: http://developer.apple.com/library/iOS/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/clm/UIView/beginAnimations:context:
他们提到不建议将其用于4.0及更高版本 如何实现3.2和4.2的视图动画。
答案 0 :(得分:0)
我真的需要支持4.0以下的版本,你可以使用它:
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDuration:1.0]; //In seconds
//Here do your stuff
int newPosY = myImage.frame.origin.y - 10;
[myImage setFrame:CGRectMake(self.frame.origin.x, newPosY, myImage.frame.size.width, myImage.frame.size.height)];
[UIView commitAnimations];
向上移动UIImageView
10个像素。
同时检查UIView
reference以查看所有可能性。