iOS开发之边缘手势返回(解决自定义返回按钮手势无效)
来源:互联网 发布:php转换大小写 编辑:程序博客网 时间:2024/05/29 18:26
如果没记错,从iOS7开始加入了屏幕边缘返回手势(无需设置),但是如果自定义返回按钮的话则失效,这时候就需要下面的方法:
因为我是系统分级的项目,所以就直接写在了UITabBarController中:
即
AppDelegate中:
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor whiteColor]; TCTabBarController *tabbarVc = [[TCTabBarController alloc]init]; self.window.rootViewController = tabbarVc;
TCTabBarController中:
TCNavigationController *nav = [[TCNavigationController alloc]initWithRootViewController:childVc]; **在这里加上下面两句** childVc.navigationController.interactivePopGestureRecognizer.enabled = YES; childVc.navigationController.interactivePopGestureRecognizer.delegate = self;//遵守UIGestureRecognizerDelegate [self addChildViewController:nav];
实现代理方法
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{ return YES;}
搞定!
0 0
- iOS开发之边缘手势返回(解决自定义返回按钮手势无效)
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- ios边缘返回手势
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决---亲测是有效的。
- iOS自定义返回按钮(不影响返回手势)
- ios 自定义返回按钮时,如何添加手势返回
- iOS手势(滑动)返回的实现(自定义返回按钮)
- iOS 自定义返回按钮又不影响手势
- iOS 解决自定义导航栏返回按钮 系统右滑返回手势失效问题 最简单方法
- 自定义滑动返回手势
- 自定义NavigationController返回手势
- ios自定义返回按钮后没有滑动返回手势处理方法
- 自定义返回按钮时,iOS7手势返回遇到的问题
- 跨浏览器复制神器 ZeroClipboard 2.x快速入门详解
- jsdoc propertype方式的注解格式
- 设计模式之:命令模式(Command Pattern)
- HouseMD, 比BTrace更实用的Java运行诊断工具
- B树索引和位图索引
- iOS开发之边缘手势返回(解决自定义返回按钮手势无效)
- 在MyEclipse中使用maven
- 17996 Daily Cool Run(动态规划dp)
- 1001. A+B Format (20)
- Linux Shell 按Tab键不能补全
- [Maven实战](7)坐标
- PHP 魔术方法__set() __get() 方法
- bzoj1026 windy数 数位dp 记忆化搜索
- 三维模型的网格细化