Ios 如何识别动画是否已完成?
我正在尝试找出我的动画是否运行并完成,或者它仍在处理中Ios 如何识别动画是否已完成?,ios,objective-c,animation,ios7,uiimage,Ios,Objective C,Animation,Ios7,Uiimage,我正在尝试找出我的动画是否运行并完成,或者它仍在处理中 animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320 , 480)]; animationImageView.animationImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage i
animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320 , 480)];
animationImageView.animationImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"], nil];
animationImageView.animationDuration = 2.2f;
animationImageView.animationRepeatCount=1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
有人能帮我吗
我在一个装有UITableviewcontroller
的容器上安装了UIview
,我从导航控制器向我的视图控制器发出了指令。现在我想在导航栏隐藏的情况下运行我的UIView
。我尝试使用代码,但无论是两个视图都有导航栏还是两个视图都没有导航栏,都是徒劳的
我正在使用故事板
实际上,我使用的是UIImageView
“Splashscreen”功能。试试这个
[UIView animateWithDuration:2.2f animations:^{
UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320 , 480)];
animationImageView.animationImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg1"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"],[UIImage imageNamed:@"eg2"], nil];
animationImageView.animationDuration = 2.2f;
animationImageView.animationRepeatCount=1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
} completion:^(BOOL finished) {
NSLog(@"Finished");
}];
要了解动画制作与否
if ([YourAnimationImageView isAnimating]) {
NSLog(@"Yes animation in progress");
}
else{
NSLog(@"NO. animation has been stopped/finished");
}
简单地写你的问题,请尝试粘贴一些代码或你做了什么来实现它你的问题太模糊了。有很多不同种类的动画。你在做UIView动画吗?民航?具体是哪种?动画完成后,您需要做什么?UIView动画和CAAnimation都具有在动画完成时运行代码的机制。