如何使ZUUIRevealController中的tableview响应平移手势
导航栏可以响应ZUUIRevealController中的平移手势。 但是我想让FrontViewController的整个屏幕响应像Path2这样的平移手势,所以我写这样的代码:
UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self.navigationController.parentViewController action:@selector(revealGesture:)]; [self.view addGestureRecognizer:recognizer];
它工作正常,除了在UITableViewController。 当我把它放在UITableViewController的viewDidLoad方法中时,表格不能响应任何其他的平移手势,所以不能滚动。
我怎样才能使它像Path2的工作:水平平移显示,垂直是像普通的表视图工作?
有一个简单的解决scheme:
在frontViewController中:
- (void)viewDidLoad { ... UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self.navigationController.parentViewController action:@selector(revealGesture:)]; recognizer.delegate = self; ... } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return TRUE; }