标签:uiwindow window make root 按钮 创建 头文件 nav 文件
1.新建类文件FirstViewController,subClass of:UIViewController
2.新建类文件MYNavigationController,subClass of:UINavigationController
3.AppDelegate.m中包含以上两个头文件,然后在didFinishLaunchingWithOptions写
FirstViewController *viewController = [[FirstViewController alloc]initWithNibName:nil bundle:nil];
MYNavigationController *navigationController = [[MYNavigationController alloc]initWithRootViewController:viewController];
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = navigationController;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyWindow];
return YES;
4.返回按钮设置
//返回按钮
UIBarButtonItem *Return = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(pop)];
self.navigationItem.leftBarButtonItems = @[Return];
标签:uiwindow window make root 按钮 创建 头文件 nav 文件
原文地址:http://www.cnblogs.com/liuzhixin-123/p/6217968.html