Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我滚动主表视图并显示搜索栏控制器时[self.searchDisplayController.searchBar becomeFirstResponder],
[self.searchDisplayController.searchBar becomeFirstResponder]
然后“取消”和“ x ”按钮不起作用。任何建议如何解决它?
你实施了UISearchBarDelegate吗?
UISearchBarDelegate
然后用这个方法
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { }