码迷,mamicode.com
首页 > 移动开发 > 详细

iOS7.1 UISearchBar 去掉黑线..

时间:2015-08-03 01:06:56      阅读:915      评论:0      收藏:0      [点我收藏+]

标签:

发现我们的应用 iOS7.1 编译后 UISearchBar 背景色是黑色

下图为正常效果(凹进去的搜索框并不是 UISearchBar 背景图片,而是一个 UIButton )

效果是点击后隐藏 UIButton 展开 UISearchBar

技术分享


iOS7.1 编译后的效果

技术分享



尝试修改barTintColor 属性

searchBar.barTintColor = [UIColor clearColor]; 修改为

searchBar.barTintColor = [R.i pinkColor];  效果

技术分享


有两条黑线,非常难看。为了去掉这二条线试过很多方法。

 

  1. 方法1.searchBar.searchBarStyle = UISearchBarStyleMinimal;   

通过以上代码可以去掉黑线,不过UISearchBarIcon, cancleButton,字体颜色等都需要改动。


继续研究并找到了最终解决方法

  1. <span style="font-size:18px;">方法2. [searchBar setBackgroundImage:[UIImage new]];  
  2. </span>  



转自:http://blog.csdn.net/jekkihun/article/details/21244167

iOS7.1 UISearchBar 去掉黑线..

标签:

原文地址:http://www.cnblogs.com/huangzs/p/4697077.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!