How to customize appearance of UISearchBar

Oscar picture Oscar · Jun 1, 2011 · Viewed 54.9k times · Source

I want to customize the search bar, I mean the white box. Can I do it? Is there some documentation about that? Is there a way to hide the white box, but not the letters. Can I at least make the box smaller? I mean less height

Answer

Ilker Baltaci picture Ilker Baltaci · Sep 11, 2012

By IOS 5.0 you have the chance to use

  [[UISearchBar appearance] setSearchFieldBackgroundImage:[UIImage imageNamed:@"searchbar.png"]forState:UIControlStateNormal];