Two-stage rotation animation is deprecated. This application should use the smoother single-stage an
生活随笔
收集整理的這篇文章主要介紹了
Two-stage rotation animation is deprecated. This application should use the smoother single-stage an
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題出在rootViewController同時包含UITabBarController和UINavigationController。
幾經嘗試,最后發現,在設置為window.rootViewController之前,先指定tabBarController.selectedIndex = 0,問題解決。
可以得出,出現上述錯誤,是因為XCode不知道你需要push哪個子viewController,在加載navigationController的時候,不知道要載入哪一個controller,于是無腦的將tabBarController的viewControllers都動畫載入了。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];self.window.backgroundColor = [UIColor whiteColor];UIStoryboard *pStoryBoard = [UIStoryboard storyboardWithName:@"FirstStoryBoard" bundle:nil];UINavigationController *pNavigationController = [pStoryBoard instantiateInitialViewController];UITabBarController *pTabBarController = (UITabBarController *)pNavigationController.visibleViewController;pTabBarController.selectedIndex = 0; /// 就是這句話[UIApplication sharedApplication].delegate.window.rootViewController = pNavigationController; /// 這句話在其他VC也可以用[self.window makeKeyAndVisible];return YES;}
轉載于:https://www.cnblogs.com/jasontec/p/9601630.html
總結
以上是生活随笔為你收集整理的Two-stage rotation animation is deprecated. This application should use the smoother single-stage an的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】visual studio 201
- 下一篇: TrimPath - Js模板引擎