zoukankan      html  css  js  c++  java
  • 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;
    
    }


  • 相关阅读:
    C#中使用MATLAB
    各种插值法及效果图对比
    Visual Studio中你所不知道的智能感知
    C#中使用Surfer
    XCode中连接使用GitHub
    个人作业Week1
    个人作业Week3
    个人作业Week2
    第一次作业——subway
    执行ajax加载页面中的js总结
  • 原文地址:https://www.cnblogs.com/jasontec/p/9601630.html
Copyright © 2011-2022 走看看