【发布时间】:2012-03-11 13:03:14
【问题描述】:
我有两个动画正在运行;显示搜索栏和显示横幅。这两个动画都在调整相同视图的大小,如果它们同时运行(它们是),最新的动画将取消调整大小。有没有办法检查 UIView 当前是否正在动画,然后等待动画?
我很确定我没有使用 CAAnimations,因为 Cocoa 没有检测到此类。
收到广告时,此广告正在运行。不幸的是,这与 ShowSearch 的运行时间相同。
- (void)adViewDidReceiveAd:(GADBannerView *)bannerView {
if (!hasloaded) {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration: 1.0];
[bannerView_ setFrame:CGRectMake(0, self.view.frame.size.height, bannerView_.frame.size.width, bannerView_.frame.size.height)];
// move and grow
[bannerView_ setFrame:CGRectMake(0, self.view.frame.size.height-50, bannerView_.frame.size.width, bannerView_.frame.size.height)];
// set original position
[UIT setFrame:CGRectMake(UIT.frame.origin.x, UIT.frame.origin.y, UIT.frame.size.width, UIT.frame.size.height)];
// move and grow
[UIT setFrame:CGRectMake(UIT.frame.origin.x, UIT.frame.origin.y, UIT.frame.size.width, UIT.frame.size.height-50)];
[UIView commitAnimations];
hasloaded = true;
}
}
【问题讨论】:
-
用
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)运行它
标签: ios cocoa-touch core-animation