OC简单实现修改UISearchBar的搜索框
//假装我懒加载了一个 UITextField:self.searchBar
///下边开始正文
1.通过下边这段代码取出来搜索框
UITextField *searchField = [self.searchBar valueForKey:@"searchField"];
2.下边对框改一波
if (searchField) {
searchField.backgroundColor = CDFColor_F7F7F7;
searchField.textColor = CDFColor_333333;
searchField.font = CDFFont(13);
searchField.layer.cornerRadius = 4;
searchField.layer.borderColor = [UIColor clearColor].CGColor;
searchField.layer.masksToBounds = YES;
searchField.clipsToBounds = YES;
}
大概就这样了
干货就是这么简单,点个赞再走呀亲!!!