美文网首页
AppDelegate里跳转其它界面

AppDelegate里跳转其它界面

作者: 姚姚先生 | 来源:发表于2018-08-23 11:11 被阅读214次

    1.模态弹出

    DJZMRZResultViewController *VC = [[DJZMRZResultViewController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:VC];
    [self.window.rootViewController presentViewController:nav animated:YES completion:nil];
    

    2.push跳转

    @interface AppDelegate : UIResponder <UIApplicationDelegate>
    
    @property (strong, nonatomic) UIWindow *window;
    
    @end
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        [self startLocationServe];
        // 创建窗口
        self.window = [[UIWindow alloc] init];
        self.window.frame = [UIScreen mainScreen].bounds;
        // 显示窗口
        self.window.rootViewController = [DJtestViewController new];
        [self.window makeKeyAndVisible];
    }
    
            UITabBarController *tab = (UITabBarController *)_window.rootViewController;
            UINavigationController *nav = tab.viewControllers[tab.selectedIndex];
            DJZMRZResultViewController *vc = [DJZMRZResultViewController new];
            vc.hidesBottomBarWhenPushed = YES;
            [nav pushViewController:vc animated:YES];
    

    搞定

    相关文章

      网友评论

          本文标题:AppDelegate里跳转其它界面

          本文链接:https://www.haomeiwen.com/subject/zfypiftx.html