recreating the ipad search bar in the contacts app
In the contacts app, the search bar is shown with a white background and it blends in well with the surrounding UI. The only style choices in Interface Builder don't se开发者_运维知识库em to show a way to host just the search bar, but instead includes chrome around it to make it look slightly 3d.
Is there a way to get rid of the surrounding chrome and simply have the search bar overlaid on my own view's background (which happens to be flat black)?
You could use the UIBarStyleBlack .barStyle
, or set the .tintColor
to black, or set the .translucent
to YES.
However, there's no documented way to change the background image of a search bar.
You may use a UITextField with a custom .background
and .leftView
to simulate the look of a UISearchBar.
精彩评论