UISearchBar的使用
2011-10-14 12:32
274 查看
searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake(0.0, 0.0, self.view.bounds.size.width, 40)];
searchBar.placeholder=@"Enter Name";
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
theTableView.tableHeaderView = searchBar;
searchBar.keyboardType = UIKeyboardTypeDefault;
//searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
//searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
[self.view addSubview: searchBar];
//search Button clicked....
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar // called when keyboard search button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}
//cancel button clicked...
- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar // called when cancel button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}
转载:http://blog.csdn.net/iorchid/article/details/6542048
searchBar.placeholder=@"Enter Name";
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
theTableView.tableHeaderView = searchBar;
searchBar.keyboardType = UIKeyboardTypeDefault;
//searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
//searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
[self.view addSubview: searchBar];
//search Button clicked....
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar // called when keyboard search button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}
//cancel button clicked...
- (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar // called when cancel button pressed
{
NSLog( @"%s,%d" , __FUNCTION__ , __LINE__ );
[searchBar resignFirstResponder];
}
转载:http://blog.csdn.net/iorchid/article/details/6542048
相关文章推荐
- UISearchBar 使用方法小结
- UISearchBar 使用方法小结
- iOS中UISearchBar(搜索框)使用总结
- UISearchBar的使用心得
- UISearchBar 搜索框 的使用方法详细
- iOS - 搜索框UISearchController的使用(iOS8.0之后替代UISearchBar + UISearchDisplayController的组合)
- UISearchBar和 UISearchDisplayController的使用
- swift中UISearchBar的使用
- swift中UISearchBar的使用
- UISearchBar 和 UISearchDisplayController的使用
- 类QQ,微信,联系人列表搜索UISearchBar使用
- UISearchBar 和 UISearchDisplayController的使用
- UISearchBar 使用方法小结
- UISearchBar的介绍以及蒙板的主流使用
- UISearchBar 和 UISearchDisplayController的使用
- UISearchBar的使用
- UISearchBar和 UISearchDisplayController的使用
- UISearchBar的使用
- iOS学习笔记:UISearchBar使用
- UISearchBar和 UISearchDisplayController的使用