2014-03-13 87 views
0

之前的SDK更新到7.1,我的搜索欄是這樣的:的iOS 7.1:圍繞搜索欄邊框

enter image description here

我使用這個代碼來實現這一影響:

searchBar.backgroundColor=[UIColor turquoiseColor]; 
[searchBar setBarTintColor:[UIColor clearColor]]; 

現在看起來像這樣:

enter image description here

如果我改變了上面的代碼的這個第二行:

[searchBar setBarTintColor:[UIColor turquoiseColor]]; 

然後我得到這個:

enter image description here

這對頂部和底部的一個怪異的黑色邊框。有想法該怎麼解決這個嗎?

回答

4

我有同樣的問題,由於某些原因,如果您使用的圖像不會發生這種情況,所以我所做的是隻用一個形象與我需要

[_searchBar setBackgroundImage:[UIImage imageNamed:@"backroundOfSearchBar"]] 
顏色