我有两个动画正在运行:显示搜索栏和显示横幅。这两个动画都在调整同一个视图的大小,如果它们同时运行(它们是同时运行的),则最新的动画将取消调整大小。是否有任何方法可以检查UIView当前是否正在进行动画,并等待动画完成?
我相当确定我没有使用CAAnimations,因为Cocoa没有检测到这样的类。
这个动画是在接收到广告时运行的。不幸的是,这与ShowSearch同时运行。
我相当确定我没有使用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 *)
方法成功运行。 - Hedam