Hja*_*mar 13
对于ios4及更高版本,您不应使用beginAnimations:context
和commitAnimations
,因为文档中不鼓励这些.
相反,您应该使用其中一个基于块的方法.
上面的例子看起来像这样:
[UIView animateWithDuration:0.3 animations:^{ // animate the following:
myLabel.frame = newRect; // move to new location
}];
Run Code Online (Sandbox Code Playgroud)
Dav*_*har 12
你正在寻找UIView的方法-beginAnimations:context:
和-commitAnimations
方法.
简而言之,您可以执行以下操作:
[UIView beginAnimations:nil context:NULL]; // animate the following:
myLabel.frame = newRect; // move to new location
[UIView setAnimationDuration:0.3];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
12719 次 |
最近记录: |