嗨我正在開發小型IOS應用程序,我想在其中顯示搜索欄和它下面的表視圖。在用戶點擊外部時我想隱藏鍵盤。出於這個原因,我使用輕觸識別器,但因爲我的表視圖停止監聽行選擇。與UITapGestureRecognizer的表格視圖
這裏是我的代碼
//inside view did load
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(dismissKeyboard)];
[self.view addGestureRecognizer:tap];
-(void)dismissKeyboard {
[_searchBar resignFirstResponder];
}
但由於表鑑於此我行選擇得到禁止。那意味着didSelectRowAtIndexPath
永遠不會被調用。任何人都有解決方案。需要幫忙。謝謝 。