UISearchBar
来源:互联网 发布:java内存泄露定位 编辑:程序博客网 时间:2024/06/08 02:39
UISearchBar
创建
UISearchBar *searchbar = [UISearchBar alloc]initWihtFream:CGRectMake:(x,y,w,h);
设置控件风格
searchbar.barStyle = UIBarStyleBlack;
设置搜素框的初始文字
searchbar.text = @"";
搜索框背景文字
searchBar.prompt = @""
搜索框内提示文字
search.placeholder = @""
向搜索框添加一个图书按钮
search.showBoookmarkButton = YES;
向搜索框添加一个取消按钮
search.showCancelButton = YES;
展示搜索结果按钮
search.showSearchResultsButton = YES;
设置搜索框光标的颜色
searchBar.tintColor = [UIColor redColor];
设置搜索框边框的颜色
searchBar.barTintColor = [UIColor blueColor];
设置搜索框整体风格
search.searchBarStyle = UISearchBarStyleProminent;
设置搜索框的附加切换试图
searchbar.showsScopeBar = YES;
searchbar.scopeButtonTitles = @[@"buttonOne",@"buttonTwo",@"buttonThree"];
searchbar.selectedScopeButtonIndex = 1;
设置键盘的附加试图
UIview *view = [UIview alloc]initWithFream:CGRectMake:(x,y,375,40)];
view.backgroundColor = [UIColor grayColor];
UILabel *label = [UILabel alloc]initWithFream:CGRectMake:(x,y.w.h)];
label.text =@"用于添加扩展功能";
label.textColor = [UIColor whiteColor];
label.textAlignment = NSTextAlignmentCenter;
[view addSubview:label];
searchBar.inputAccessoryView = view;
添加到视图上
[self.view addSubview:searchbar]
阅读全文
0 0
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UISearchBar
- UIsearchBar
- UISearchBar
- UISearchBar
- HtmlAgilityPack HtmlWeb.Load() 不支持 gzip 的解决方法
- 代币,YouTube 的区块链解决方案
- dynamicMerge与Merge
- Unreal Engine UE4开发技巧
- BDTC 2017 | 学术、行业、货币专家共话区块链的现状和未来
- UISearchBar
- 利用TF-IDF建立一个文档恢复系统
- 靠谱的区块链应用到底是啥?通证啊!——第二次中关村-CSDN区块链开发技术沙龙【含PPT下载】
- Event事件机制
- 【挖祖坟】聊聊“密码朋克”运动与区块链发展路径
- vue windows下安装过程及遇到的问题
- postfix配置QQ邮箱发邮件
- 通证经济系统设计的一个优秀范例——般若链
- ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form