views:

34

answers:

1

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 seem 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)?

A: 

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.

KennyTM