Core Animation for UIView.frame

依然范特西╮ 提交于 2019-12-02 03:16:29

For something as simple as this, you don’t really need to use Core Animation directly—UIView’s built-in animation system should suffice.

[UIView animateWithDuration:1.0 animations:^{
    self.adBanner.frame = adFrame;
    self.ButtonView.frame = buttonViewFrame;
}];

or, if you’re targeting pre-4.0 iOS,

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
    self.adBanner.frame = adFrame;
    self.ButtonView.frame = buttonViewFrame;
[UIView commitAnimations];
Satvik
[UIView beginAnimations : @"Display notif" context:nil];

[UIView setAnimationDuration:1];

[UIView setAnimationBeginsFromCurrentState:FALSE];

CGRect frame = mainView.frame;

frame.size.height -= 40;

frame.origin.y += 40;

mainView.frame = frame;

[UIView commitAnimations];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!