iOS 搜索框
来源:互联网 发布:时代网络大厦 美食 编辑:程序博客网 时间:2024/05/21 22:30
创建在tableview上面的搜索框
table = [[UITableViewalloc]initWithFrame:CGRectMake(0,0, self.view.frame.size.width,self.view.frame.size.height)style:UITableViewStylePlain];
table.delegate =self;
table.dataSource =self;
table.tableFooterView = [[UIViewalloc] initWithFrame:CGRectZero];
//****************
table.allowsMultipleSelectionDuringEditing =YES;
[self.viewaddSubview:table];
// 创建搜索框
UISearchBar * searchB = [[UISearchBaralloc]initWithFrame:CGRectMake(0,0, 0, 80)];
// 设置提示文字
searchB.placeholder = @"请输入文字";
// 设置搜索框的样式
searchB.searchBarStyle =UISearchBarStyleDefault;
// 是否显示取消按钮
searchB.showsBookmarkButton =YES;
// 建立代理关系
searchB.delegate = self;
displayController = [[UISearchDisplayControlleralloc]initWithSearchBar:searchBcontentsController:self];
displayController.searchResultsDelegate =self;
displayController.searchResultsDataSource =self;
displayController.searchResultsTableView.tableFooterView = [[UIViewalloc]initWithFrame:CGRectZero];
table.tableHeaderView = searchB;
搜索代理方法
- (NSArray*)sectionIndexTitlesForTableView:(UITableView *)tableView{
returnsearchArray;
}
- IOS笔记 搜索框
- 自定义iOS搜索框
- ios开发搜索框
- iOS搜索框UISearchBar
- ios 搜索框
- iOS搜索框
- iOS 搜索框
- iOS 搜索框
- 仿IOS搜索框
- iOS 搜索框search bar开始搜索
- 搜索图标居中的搜索框~iOS风格搜索框
- ios 上弹搜索框
- iOS 导航栏上加搜索框
- iOS搜索框的实现
- iOS 搜索框之UISearchBar
- iOS中UISearchBar(搜索框)
- iOS搜索框的实现
- iOS UISearchBar调整搜索框的颜色
- jquery 合并单元格
- 文件下载
- printf函数缓冲区问题
- 考考你的C语言
- Postman工具
- iOS 搜索框
- 分区表的导入导出 expdp&impdp Oracle 11.2.0.4
- SQL 查尋(分组/group by/count/sum/avg/max/min/null/having/top/over) 排序(rwo_number/rank/dense_raenk/ntile)
- 原码, 反码, 补码 详解
- sql server 解决union all之后 order by失效的问题
- heartbeat 高可用工具
- vim编辑的文档出现中文乱码
- 浅谈Android线程池封装
- 学习Android从0开始之背景篇-Android系统介绍