您的位置:首页 > 产品设计 > UI/UE

设置 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"];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: