2012-06-01 51 views
1

我试图颜色搜索栏这样的背景,但是当我把搜索它不工作..的UISearchBar的backgroundColor

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar 
{ 
searchBar.backgroundColor = [UIColor redColor]; 

} 

回答

10

你想改变搜索栏或浅色背景色的背景的搜索栏? 喜欢这个 - > enter image description here

如果是使用此行的代码

searchBar.tintColor = [UIColor blackColor]; 
+0

是的,但我会改变RHE搜索栏的bakground ... – Antilope

+0

请你告诉我做什么你的意思是由搜索栏的背景!我的意思是你可以通过编辑你的答案发布你的需求的一些图像。 –

+0

它的bcoz我写了我的代码中的同一行,但它没有做任何事情,事实上我也得到了它会改变搜索栏的背景吗? –

1
change tintColor of searchBar 

searchBar.tintColor = [UIColor redColor];