我需要你的幫助。 在我的應用程序中,我按下按鈕並開始動畫。在這個動畫之後,我想在不按任何其他按鈕的情況下自動更改視圖。 我該怎麼辦?如何在動畫後更改視圖?
這裏我的代碼,我認爲我是在正確的方式,但動畫無法啓動,只更改視圖和xcode不會給我一個錯誤消息。
- (IBAction)button {
[UIView animateWithDuration:2.5f animations:^{
NSArray *playAnimation;
playAnimation= [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@「image1.png"],
[UIImage imageNamed:@「image2.png"],
[UIImage imageNamed:@"image3.png"],
[UIImage imageNamed:@"image4.png"],
[UIImage imageNamed:@"image5.png"],
[UIImage imageNamed:@"image6.png"],
[UIImage imageNamed:@"image7.png"],
Nil];
}
completion:^(BOOL finished) {
UIStoryboard *Scene1 = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *Sc1 = [Scene1 instantiateViewControllerWithIdentifier:@"ViewController"];
[self presentViewController:Sc1 animated:NO completion:nil];
}];
}
的幫助
@rene我沒有錯誤消息,但動畫沒有啓動它只改變視圖 – user3242391