我在我的應用程序中使用SWRevealViewController,並遇到問題。我在場景中有一個文本框,如果我在鍵盤打開時向左滑動,出現菜單,但不會關閉鍵盤。如何在左側滑動時關閉鍵盤? 我試圖SWRevealViewController在刷卡時關閉鍵盤
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)];
swipe.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeRecognizer];
-(void)dismissKeyboard
{
[self.textField resignFirstResponder];
}
,但它不工作,我想是因爲我已經在使用一個panGestureRecognizer爲revealViewcontroller即[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
我也使用UITapGestureRecognizer
但它僅適用於自來水不刷卡。 我希望這個問題有一個非常簡單的解決方案,任何人都可以幫忙嗎?
謝謝,FrontView中的
看到我的答案希望可以幫助你.. –
看到我更新了我的答案檢查它 –