#import "INTextViewController.h"
@interface INTextViewController ()<UIGestureRecognizerDelegate>
@end
@implementation INTextViewController
- (void)viewDidLoad{
[super viewDidLoad];
//因为你覆盖了系统的返回按钮,(董铂然博客园原创)系统将会通过代理禁用这个滑动返回功能,你提前把代理给踢了,这样滑动返回功能就能报住了。
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
// 进入这个控制器时隐藏导航栏
[self.navigationController setNavigationBarHidden:YES animated:animated];
}
- (void)viewWillDisappear:(BOOL)animated{
// 显示导航栏
[self.navigationController setNavigationBarHidden:NO animated:animated];
}
@end
!原文链接
网友评论