首页 > 移动平台 > 详细

iOS searchbar textfield placeholder color

时间:2016-05-28 17:13:47      阅读:166      评论:0      收藏:0      [点我收藏+]

 

 

// Get the instance of the UITextField of the search bar

UITextField *searchField = [searchBar valueForKey:@"_searchField"];

// Change search bar text color
searchField.textColor = [UIColor redColor];

// Change the search bar placeholder text color
[searchField setValue:[UIColor blueColor] forKeyPath:@"_placeholderLabel.textColor"];

//Change search bar icon if needed
[self.searchBar setImage:[UIImage imageNamed:@"searchIcon"]
   forSearchBarIcon:UISearchBarIconSearch
              state:UIControlStateNormal];



[self.searchBar setValue:[UIColor whatever] forKeyPath:@"_searchField._placeholderLabel.textColor"];

  

iOS searchbar textfield placeholder color

原文:http://www.cnblogs.com/ficow/p/5537813.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!