ios7.0后,从左侧边缘向右滑动会自动返回上一级页面,但如果返回按钮是自定义的话,项目会崩。
此时可以在自定义返回按钮的页面中禁止此功能,在PUSH到这个页面时
QRCodeController *qrcodeVC = [[QRCodeController alloc] init];
qrcodeVC.hidesBottomBarWhenPushed = YES;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
[self.navigationController pushViewController:qrcodeVC animated:YES];
从这个页面返回的时候
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
[self.navigationController popViewControllerAnimated:YES];