8-21 UINavigationController
来源:互联网 发布:虚拟社交网络的优点 编辑:程序博客网 时间:2024/05/22 11:49
UINavigationController
UINavigationController *nvc;FirstViewController *fvc = [[FirstViewController alloc] init];//初始化一个视图控制器对象nvc = [[UINavigaitonController alloc] initWithRootViewController:fvc];或者nvc = [[UINavigationController alloc] init];[nvc pushViewController:cvc animated:YES];//nvc.viewController = @[fvc];self.window.rootViewController = mvcself.title//设置导航条的中间文字self.navigationItem.leftBarButtonItem//左边文字设置self.navigationItem.rightBarButtonItem//右边文字设置self.navigationItem.backBarButtonItem//下一界面左边文字设置,如果下一界面有自定义的左边文字,则以下一界面的设置为准
页面跳转方法
进栈- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;出栈- (UIViewController *)popViewControllerAnimated:(BOOL)animated;//返回上一个界面- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;//返回到第一个界面- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;//返回到指定页面
popToViewController的用法详解
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];或for (UIViewController *temp in self.navigationController.viewControllers) { if ([temp isKindOfClass:[你要跳转到的Controller class]]) { [self.navigationController popToViewController:temp animated:YES]; } }
0 0
- 8-21 UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- UINavigationController
- Queue和Stack头文件的使用
- 原串翻转(Java)
- ZOJ 3776 Pokemon Master
- Nginx开发从入门到精通二
- bash手册翻译#3.1 shell语法
- 8-21 UINavigationController
- ZOJ 3778 Talented Chef
- 读书计划又启动了——代码大全2(1)
- C语言二叉树的数据结构实现
- uva 10719 - Quotient Polynomial
- C语言基础知识之(五):break 和 continue 运用详解
- java内存溢出示例(堆内存、栈内存)
- Nginx开发从入门到精通三
- 虚拟机搭建Hadoop集群(1) ---nat模式