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

设置 UISearchBar 输入字体颜色 和 默认字体颜色

2013-01-17 17:17 911 查看
UISearchBar *searchBar = [[UISearchBar
alloc] initWithFrame:CGRectMake(0,
0, 210,
44)];

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

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

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

// Change the search bar placeholder text color
[searchField
setValue:[UIColor
blackColor]
forKeyPath:@"_placeholderLabel.textColor"];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: