码迷,mamicode.com
首页 > 其他好文 > 详细

UISearchBar的使用

时间:2014-06-18 20:39:48      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:class   tar   ext   com   width   使用   

  1. searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0.0, 0.0, self.view.bounds.size.width, 40)];  
  2.     searchBar.placeholder=@"Enter Name";  
  3.     searchBar.delegate = self;  
  4.     searchBar.showsCancelButton = YES;  
  5.     theTableView.tableHeaderView = searchBar;  
  6.     searchBar.keyboardType = UIKeyboardTypeDefault;  
  7.     //searchBar.autocorrectionType = UITextAutocorrectionTypeNo;  
  8.     //searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;  
  9.       
  10.     [self.view addSubview: searchBar];  
  11.   
  12. //search Button clicked....  
  13. - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar                     // called when keyboard search button pressed  
  14. {  
  15.     NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );  
  16.     [searchBar resignFirstResponder];  
  17. }  
  18. //cancel button clicked...  
  19. - (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar                    // called when cancel button pressed  
  20. {  
  21.     NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );  
  22.       
  23.     [searchBar resignFirstResponder];  
  24.       
  25. }  

UISearchBar的使用,布布扣,bubuko.com

UISearchBar的使用

标签:class   tar   ext   com   width   使用   

原文地址:http://www.cnblogs.com/yulang314/p/3790439.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!