在window中设置导航控制器
FirstViewController *first=[FirstViewController alloc];
UINavigationController *controller=[[UINavigationController alloc]initWithRootViewController:first];
self.window.rootViewController=controller;
controller.navigationBar.barTintColor=[UIColor greenColor];
设置页面导航控制器的内容
self.navigationItem.title=@"首页";
self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"右侧" style:UIBarButtonItemStylePlain target:self action:@selector(touchRight)];
设置导航控制器的按钮点击事件
-(void)touchRight{
SecondViewController *second=[[SecondViewController alloc]init];
[self.navigationController pushViewController:second animated:YES];
[self.navigationController popViewControllerAnimated:YES];
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)