1、理解NavigationController返回机制

一般NavigationController下的子view只有一层或者有很多层,子view返回最顶层则可以直接用

[self.navigationController popViewControllerAnimated:YES];

如果NavigationController下有好几层子view,当前子view返回上一层,则可以用

[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:([self.navigationController.viewControllers count] -)] animated:YES];

-3为上上一层,依此类推。push和pop的方法类似。

2、手势右滑返回上一层

控制器添加代理UIGestureRecognizerDelegate

self.navigationController.interactivePopGestureRecognizer.delegate = self;

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{

    //判断是否是导航条的第一个子视图控制器
if (self.navigationController && [self.navigationController.viewControllers count] >= ) {
return YES;
}else{
return NO;
}
}

模态、导航栏混合模式

https://www.cnblogs.com/dingding3w/p/6222626.html

最新文章

  1. C#基础知识二之this关键字
  2. 黑马程序员——C语言基础 流程控制 选择结构和循环结构
  3. 可能是Mac环境变量恢复的参考
  4. python开发 Day1 python基础
  5. LOB字段存放在指定表空间 清理CLOB字段及压缩CLOB空间
  6. c#高效的线程安全队列ConcurrentQueue<T>(上)
  7. 父节点使用css的transform: translate(0, 0)时position:fixed在chrome浏览器中无效
  8. SPRING IN ACTION 第4版笔记-第二章Wiring Beans-005-<constructor-arg>和c-namespace
  9. 服务器后端开发系列——《实战FastDFS分布式文件系统》[转]
  10. 原生javascript扫雷游戏
  11. Java 架构师之路(1)
  12. CF 375D. Tree and Queries【莫队 | dsu on tree】
  13. Algorithm --> 十大排序算法
  14. 知识小罐头08(tomcat8启动源码分析 上)
  15. Python_每日习题_0006_斐波那契数列
  16. jdk8-lanbda方法引用和构造引用
  17. ORA-12560: TNS: 协议适配器错误的解决方法
  18. POJ 1597 Function Run Fun
  19. Fang Fang---hud5455(字符串处理)
  20. windows上安装Gradle并配置环境变量

热门文章

  1. 二分查找java实现
  2. python gevent协程
  3. ESA2GJK1DH1K升级篇: STM32远程乒乓升级,升级流程源码详细说明
  4. Set和Multiset 怎么用咧↓↓↓
  5. 【Gamma阶段】第六次Scrum Meeting
  6. Sc config http start= disabled
  7. 【c# 学习笔记】c#委托是什么
  8. HashMap源码1
  9. [转帖]direct path read直接路径读
  10. 【1】【经典回溯、动态规划、贪心】【leetcode-55】跳跃游戏