侧滑返回功能失效解决
来源:互联网 发布:网络媒介推广 编辑:程序博客网 时间:2024/05/22 00:36
自定义一个UINavigationController,实现几个代理方法
@interface CustomNavigationController : UINavigationController@end
#import "CustomNavigationController.h"@interface CustomNavigationController ()<UINavigationControllerDelegate, UIGestureRecognizerDelegate>@property(nonatomic, weak) UIViewController *currentShowVC;@end@implementation CustomNavigationController- (instancetype)initWithRootViewController:(UIViewController *)rootViewController { CustomNavigationController *nav = [super initWithRootViewController:rootViewController]; nav.interactivePopGestureRecognizer.delegate = self; nav.delegate = self; return nav;}- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if (1 == navigationController.viewControllers.count) { self.currentShowVC = nil; } else { self.currentShowVC = viewController; }}- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer == self.interactivePopGestureRecognizer) { return (self.currentShowVC == self.topViewController); } return YES;}- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) { return YES; } else { return NO; }}@end
然后,将你的UINavigationController都替换成该自定的NavigationController就OK了
解决iOS7自定义返回按钮后不能侧滑返回的问题
标签:uinavigationcontroller pop 侧滑返回
0 0
- 侧滑返回功能失效解决
- 自定义返回按钮后,右滑返回功能失效解决方法
- ios7之后自定义返回按钮后,右滑返回功能失效解决方法
- ios7自定义返回按钮后,右滑返回功能失效解决方法
- 自定义nav返回按钮后,自带的右滑返回功能失效解决方法
- iOS-自定义导航栏后侧滑返回功能失效
- iOS-自定义导航栏后侧滑返回功能失效
- iOS-自定义导航栏后侧滑返回功能失效
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- 自定义导航的返回按钮 导致右滑返回失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- 如何解决VC自动成员功能失效
- 解决 eclipse 自动完成功能失效
- ios 自定义返回按钮侧滑失效完美解决方案
- Unity接口函数Vector3.Project()
- struts2拦截器问题
- 写代码,请不要中断
- 【LeetCode】Binary Tree Level Order Traversal 解题报告
- 杭电acm--1040
- 侧滑返回功能失效解决
- centos7 matlab install
- linux上应用程序的执行机制
- Rotate Array
- PYTHON数据可视化
- 如何在ROS下编写自己的节点来订阅话题(C++)
- ps
- UIView与CALayer的理解
- Objective-C中代码块的学习