设置 UISearchBar 输入字体颜色 和 默认字体颜色
2016-04-19 11:29
477 查看
UISearchBar *searchBar = [[UISearchBaralloc]
initWithFrame:CGRectMake(0,0,
210, 44)];
serchBar.searchBarStyle = UISearchBarStyleMinimal;
serchBar.delegate = self;
serchBar.placeholder = @"输入搜索内容";
// Get the instance of the UITextField of the search bar
UITextField *searchField = [searchBar
valueForKey:@"_searchField"];
// Change search bar text color
searchField.textColor = [UIColorblackColor];
// Change the search bar placeholder text color
[searchFieldsetValue:[UIColorblackColor]forKeyPath:@"_placeholderLabel.textColor"];
initWithFrame:CGRectMake(0,0,
210, 44)];
serchBar.searchBarStyle = UISearchBarStyleMinimal;
serchBar.delegate = self;
serchBar.placeholder = @"输入搜索内容";
// Get the instance of the UITextField of the search bar
UITextField *searchField = [searchBar
valueForKey:@"_searchField"];
// Change search bar text color
searchField.textColor = [UIColorblackColor];
// Change the search bar placeholder text color
[searchFieldsetValue:[UIColorblackColor]forKeyPath:@"_placeholderLabel.textColor"];
相关文章推荐
- UIScrollview--使用Autolayout添加约束
- UIUITextView设置类似于UITextField的placeholder
- [转]优化UITableViewCell高度计算的那些事
- 使用网站websequencediagrams在线画时序图
- Java Builder模式 初体验
- UIAlertView 基础篇
- iOS开发 贝塞尔曲线UIBezierPath
- Android酷炫实用的开源框架(UI框架)
- Parquet与ORC性能测试报告
- continue、break、return的区别
- 获得request、response对象的三种方法
- IOS中UIImage用代码压缩
- request.getHeader("x-forwarded-for")这是什么意思
- 自定义UILabel设置垂直方向的居上,居中,居下
- List Set Queue Map
- [转]Excel导入异常Cannot get a text value from a numeric cell解决
- iOS9 UIStackView 简介
- build.gradle and gradle.property的关系和部分使用
- extJs.QuickTips
- RecyclerView之更新UI数据的高级用法