[英]Transition between two UIViewControllers with no animation
從我的appDelegate中,我像這樣加載homeScreen ViewController:
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *controller = [sb instantiateViewControllerWithIdentifier:@"HomeScreen"];
[self.window setRootViewController:controller];
然后,該應用程序才在我的“ homeScreen”和“ PlayViewController” ViewController之間切換,這是這樣完成的:
PlayViewControlller* vc = [self.storyboard instantiateViewControllerWithIdentifier:@"PlayViewController"];
[self presentModalViewController:vc animated:NO];
和這個
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *controller = [sb instantiateViewControllerWithIdentifier:@"HomeScreen"];
[self presentModalViewController:controller animated:NO];
分別。
這一切都很好。 我可以使用uibutton和上面的代碼在視圖控制器之間進行切換。 但是,我不確定是什么原因造成的,它是在我兩次在兩個視圖控制器之間切換之后發生的,但是過渡開始變得生動起來,並且切換時它們開始旋轉。
好的,所以我試圖縮小問題的范圍,並查看引起問題的原因。 我認為這是我在應用中使用的其他動畫塊。 但是那里有很多東西,所以不知道到底是什么。
好的,所以如果有人碰巧遇到相同的情況,我發現了引起這一問題的代碼行。
[UIView beginAnimations:@"Move" context:NULL];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.