在键盘上,键盘不会隐藏.
请帮我解决这个问题.
这是我的代码
-(voID)search:(UISearchbar*)searchbar Text:(Nsstring*)text{ [copylistofItems removeAllObjects]; if([text length] > 0) { // [ovController.vIEw removeFromSupervIEw]; searching = YES; Nsstring *searchText = searchbar.text; for(imergencyData *objtrust in aryTrustee) { NSRange TitleResultsRange = [objtrust.strname rangeOfString:searchText options:NSCaseInsensitiveSearch]; if (TitleResultsRange.length > 0) [copylistofItems addobject:objtrust]; } NSLog(@"number of object found %d",copylistofItems.count);}else { // [tblTrustee insertSubvIEw:ovController.vIEw aboveSubvIEw:self.parentVIEwController.vIEw]; [searchbar resignFirstResponder]; searching = NO; //tblTrustee.scrollEnabled = NO;}[tblTrustee reloadData];}-(voID)searchbarTextDIDEndEditing:(UISearchbar *)aSearchbar { [aSearchbar resignFirstResponder]; [self.vIEw endEditing:YES]; } //Method call when type text in search Box-(voID)searchbar:(UISearchbar *)theSearchbar textDIDChange:(Nsstring *)searchText { [self search:theSearchbar Text:searchText];}//method call when on search button-(voID)searchbarSearchbuttonClicked:(UISearchbar *)searchBa{ [searchBa endEditing:YES]; [searchBa resignFirstResponder]; [self search:searchBa Text:searchbar.text];}解决方法 把这行代码尝试一次,
- (voID)searchbarTextDIDEndEditing:(UISearchbar *)aSearchbar { [aSearchbar resignFirstResponder]; [self.vIEw endEditing:YES];}
(要么)
编辑:
- (voID)searchbarSearchbuttonClicked:(UISearchbar *)searchbar{ [searchbar resignFirstResponder]; [self.vIEw endEditing:YES]; }总结
以上是内存溢出为你收集整理的ios – 无法在UISearchBar中单击搜索按钮时隐藏键盘全部内容,希望文章能够帮你解决ios – 无法在UISearchBar中单击搜索按钮时隐藏键盘所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)