Has anyone any idea or code sample on how can I change the text color of the placeholder text of a UISearchBar?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- How to update placeholder text in ng2-smart-table?
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
This solution works on Xcode 8.2.1. with Swift 3.0. :
Usage example:
Found the answer from Change UITextField's placeholder text color programmatically
Try this:
After surveyed a couple of answers, I come out this, hope its help
This is an old question, but for anyone stumbling on it nowadays, you can change the search icon on iOS 8.x - 10.3 using the following:
Regarding the placeholder text color, you may check my other answer, which uses a Category, here: UISearchBar change placeholder color
First solution is OK, but if you use multiple UISearchBar, or create a lot of instances it may fail. The one solution that always work for me is to use also appearance proxy but directly on UITextField