标签:style blog http ar color sp on div 2014
1 通过nib方式
// bundle:nil参数传nil,指的是从mainbundle中加载,mainbundle中包含项目中所有的资源 MJThreeViewController *three = [[MJThreeViewController alloc] initWithNibName:@"MJThree5345" bundle:nil]; self.window.rootViewController = three;
2 通过代码的方式
// 根据代码创建控制器 UIViewController *vc = [[UIViewController alloc]init]; vc.view.backgroundColor = [UIColor blueColor]; self.window.rootViewController = vc;
3 根据storyboard创建控制器
// 根据storyboard创建控制器 UIStoryboard *board = [UIStoryboard storyboardWithName:@"one" bundle:nil]; UIViewController *vc = [board instantiateViewControllerWithIdentifier:@"myredview"]; self.window.rootViewController = vc;
标签:style blog http ar color sp on div 2014
原文地址:http://www.cnblogs.com/xiaokanfengyu/p/4146780.html