iOS开发之不会就百度: UISearchController 修改外观
来源:互联网 发布:linux 重启网络 编辑:程序博客网 时间:2024/04/28 15:40
- (void)initSearchController{
_searchController = [[UISearchControlleralloc] initWithSearchResultsController:nil];
_searchController.searchBar.tintColor =LogoColor;
_searchController.searchBar.barTintColor = [UIColorwhiteColor];
_searchController.searchResultsUpdater =self;
//是否显示遮罩
_searchController.dimsBackgroundDuringPresentation =NO;
//不让搜索的时候隐藏navigationBar
_searchController.hidesNavigationBarDuringPresentation =NO;
//显示搜索结构的按钮
_searchController.searchBar.showsSearchResultsButton =NO;
_searchController.searchBar.placeholder =@"输入****";
_searchController.searchBar.delegate =self;
[_searchController.searchBarsizeToFit];
//想修改得设置为YES 或者 在info 里修改Localization native development region 属性为china就是修改改app所有的系统文字为中文
_searchController.searchBar.showsCancelButton = YES;
for(UIView *searchin _searchController.searchBar.subviews){
NSMutableArray *array = [search valueForKeyPath:@"subviewCache"];
NSLog(@"array %@",array);
for (id subviewin array) {
if ([subview isKindOfClass:[UIButton class]]) {
UIButton *cancel = (UIButton *)subview;
cancel.titleLabel.font = [UIFontsystemFontOfSize:14];
[cancel setTitle:@"自定义" forState:UIControlStateNormal];
[cancel setTitleColor:LogoColorforState:UIControlStateNormal];
}
//修改输入框外观
if ([subview isKindOfClass:[UITextField class]]) {
UITextField *textField = (UITextField *)subview;
textField.layer.borderWidth =0.5f;
textField.layer.borderColor = [LineColor221CGColor];
textField.layer.cornerRadius =5.0f;
textField.layer.masksToBounds =YES;
}
}
}
}
- iOS开发之不会就百度: UISearchController 修改外观
- iOS开发基础 - UISearchController
- iOS 开发-修改 UISearchController中 searchBar 的取消按钮颜色
- iOS开发实战之搜索控制器UISearchController使用
- iOS开发之高级视图—— UISearchController
- iOS开发-搜索栏 UISearchController
- IOS开发之UISearchBar自定义外观
- IOS开发之UISearchBar自定义外观
- iOS开发-------简单通讯录2(UISearchController)
- iOS开发 搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发——搜索框(UISearchController)
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS UISearchController
- iOS - UISearchController
- 关于java、Android中Math的一些用法
- csdn boke
- 如何安全删除基于对话框的MFC中控件的事件处理程序
- 音频技术之调节音量及设置静音
- Django的标准库django.contrib包介绍
- iOS开发之不会就百度: UISearchController 修改外观
- Struts2 if/else标签
- groupByKey实例分析Spark Hash Shuffle
- FragmentPagerAdapter的理解
- cordova 常用命令,插件
- Linux的特殊文件系统-----
- unity 后台
- myeclipse 2015 ci 16更新说明及下载
- Hibernate的悲观锁和乐观锁