How can set the background image, or clear the background, of a search bar, like the note application?
相关问题
- 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
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用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
Set background image
Look here: UISearchbar background image change
One liner:
I just came up with a solution that works really well. You have to override the UISearchBar and then hide both the Background and Segment Control layers. Then Draw the background.
@ .m
@ .h
Hope this helps!
I prefer to just set the alpha to 0 so you can hide/show on demand.
How to set background color in UISearchBar:
Then make an outlet connection to search bar (say,
objSearchbar
), and use these lines :