2016-02-19 114 views
0

我想在的tableView添加的UITableViewController一個UIPanGestureRecognizer 但如果我添加的UITableViewController與UIGestureRecognizer

- (void)viewDidLoad { 
    // code 
    UIPanGestureRecognizer *gestureRecognizer = nil; 
    gestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; 
    gestureRecognizer.maximumNumberOfTouches = 1; 
    gestureRecognizer.delegate = self; 
    gestureRecognizer.cancelsTouchesInView = NO; 
    [self.tableView addGestureRecognizer:gestureRecognizer]; 
    // code  
} 

然後整個表沒有任何迴應的姿態,除了一個 - 我 例如:不滾動手勢

是否可以解決這個問題的UITableViewController?

回答

0

如果我找到了你,你希望桌面視圖可以滾動,但仍然可以識別平移手勢嗎?

您是否嘗試過從UIGestureRecognizerDelegate執行此方法?

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer 
{ 
    return YES; 
} 
相關問題