猜測可能原因
1、底部Tabbar隱藏馆纳、顯示調(diào)用頻繁诗良,或者重復(fù)調(diào)用
2、右劃返回手勢沖突
研究歷程
1厕诡、多次使用累榜,發(fā)現(xiàn)出現(xiàn)的情況多在一級頁面跳轉(zhuǎn)到二級頁面,Tabbar卡死营勤,點Home鍵切換APP到后臺灵嫌,重新打開,右劃返回后即可使用
得出結(jié)果
1葛作、在RootViewController右劃返回手勢也可以響應(yīng)寿羞,因為沒有上一級頁面,導(dǎo)致整個程序頁面不響應(yīng)
APP做出如下修改
在一級頁面進(jìn)入和離開時 分別添加禁用和開啟右滑返回手勢
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self forbiddenSideBack];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[self resetSideBack];
}
禁用手勢
/**
* 禁用邊緣返回
*/
-(void)forbiddenSideBack{
self.isCanSideBack = NO;
//關(guān)閉ios右滑返回
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate=self;
}
}
/*
恢復(fù)邊緣返回
*/
- (void)resetSideBack {
self.isCanSideBack=YES;
//開啟ios右滑返回
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)gestureRecognizer {
return self.isCanSideBack;
}