模拟ios应用加载页面
1:设置应用程序系统主界面加载接口为空:Main interface=null;
2: 在AppDelegate实现didFinishLaunchingWithOptions方法
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // 初始化窗口 self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; // 设置窗口颜色 self.window.backgroundColor=[UIColor redColor]; // 自定义viewcontroller // UIViewController *root=[[UIViewController alloc]init]; // root.view.backgroundColor=[UIColor blueColor]; // 创建UIStoryboard对象 UIStoryboard *storybord= [UIStoryboard storyboardWithName:@"Main" bundle:nil]; // 1:创建指定storybordId的viewcontroller UIViewController *root=[storybord instantiateViewControllerWithIdentifier:@"green"]; // 2:创建指定默认的viewcontroller // UIViewController *root2=[storybord instantiateInitialViewController]; // 设置rootViewController self.window.rootViewController=root; //显示窗口 [self.window makeKeyAndVisible]; return YES; }
posted on 2017-03-23 23:46 张亮13128600812 阅读(141) 评论(0) 编辑 收藏 举报