zoukankan      html  css  js  c++  java
  • 遇到别人留下的storyboard的,你需要一个引导图,但是不知道怎么跳转.

    首先在AppDeledate.m文件里是这样.

    {
        self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
        self.window.backgroundColor = [UIColor whiteColor];
        [self.window makeKeyAndVisible];
        
        if (![[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) {
            [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"firstLaunch"];
            //        NSLog(@"第一次启动");
            //如果是第一次启动的话,使用UserGuideViewController(用户引导页面) 作为根视图
            UserGuideViewController *userViewController=[[UserGuideViewController alloc]init];
            self.window.rootViewController=userViewController;
        }else{
            NSLog(@"不是第一次启动");
            [self  showHomeViewController];
        }
    //跳转到Main
    - (void)showHomeViewController
    {
        [[UIApplication sharedApplication]setStatusBarHidden:NO];
        UIStoryboard *storyBoard =  [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        
        self.window.rootViewController = [storyBoard instantiateInitialViewController];
    }

    然后如果你是第一次实用程序

    在你的

    UserGuideViewController.m文件里
    //按钮的触发时间
    -(void)firstpressed{
        //跳转至正文
        [[UIApplication sharedApplication]setStatusBarHidden:NO];
        UIStoryboard *storyBoard =  [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        
        
        
        [self presentViewController:[storyBoard instantiateInitialViewController] animated:YES completion:nil];
    
    }
  • 相关阅读:
    正确使用 Volatile 变量
    什么叫持久化?
    大型J2EE项目中的Web容器集群–Nginx+Glasshfish+Memcached+ServletFilter
    REST
    Java多线程设计模式:wait/notify机制
    Java Persistence API (JPA) 的陷阱
    JDK1.5新特性介绍
    用Amazon EC2搭建免费WordPress博客及SSH
    PDF Split and Merge Basic 好用的PDF合并分割工具
    路威机器人
  • 原文地址:https://www.cnblogs.com/fume/p/5655683.html
Copyright © 2011-2022 走看看