1

我使用ECSlidingViewController的漢堡包菜單和我的代碼添加到我的viewDidLoad方法:的iOS手勢碰撞對控制器

[self.slidingViewController.topViewController.view addGestureRecognizer:self.slidingViewController.panGesture]; 

現在我有鍋的姿態展現右鍵菜單或隱藏。沒關係。但是我有觀看滑塊,讓他工作真的很難。我必須點擊確切的位置。是否可以將它設置爲精確的矩形(在包含滑塊的視圖中),滑塊將以手勢方式應答,而在其他部分則會像現在一樣工作?

還有一個問題。當我有導航控制器與表,然後我繼續細節,然後我顯示右菜單沒關係,但是當我想通過平移關閉它,我首先回到導航,然後關閉菜單。有沒有可能改變這個命令?

回答

1

您是否嘗試過設置UIGestureRecognizerDelegate並以與FAO中所述類似的方式處理兩個手勢識別?

例如爲:

#pragma mark - UIGestureRecognizerDelegate 

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { 
    if ([otherGestureRecognizer.view isKindOfClass:[UISlider class]]) { 
     return YES; 
    } else { 
     return NO; 
    } 
}