ios - UISearchBar 更改占位符颜色

标签 ios uisearchbar placeholder

有人知道如何更改 UISearchBar 占位符文本的文本颜色吗?

最佳答案

对于 iOS5+ 使用外观代理

[[UILabel appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor redColor]];

关于ios - UISearchBar 更改占位符颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11827585/

相关文章:

java - 我应该单独学习 JavaFX for Android 还是 Android

ios - Swift - UISearchBar 抛出 "this class is not key value coding-compliant for the key searchBar"

swift - 搜索栏过滤 TableView swift 4

html - 当 <input> 具有占位符文本时,ios6 Safari 方向更改错误

text - 清除 TextField 时如何恢复占位符文本

ios - React Native 中的背景 gps 位置

ios - 从 Go appengine 站点发送 Apple 推送通知

css - 为什么占位符伪元素的过渡属性在 Chrome 中有效?

ios - 如何使用 iOS 核心 API 获取 dropbox 文件夹中存在的视频 url

ios - UISearchbar 静态表格 View