2014-03-13 90 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"]] 
颜色