当前位置:首页 > 操作系统 > Ios

iOS 去掉导航栏的边界灰线;去掉搜索框的边界灰线和其中文本输入框的阴影

技术分享

想要实现上面这种界面,一般都会显示的与预期的不一致,尽管我们设置的颜色是一样。通过下面的步骤就可以实现:

1.关闭navigationBar的透明度

  self . navigationController . navigationBar . translucent = NO ;


2.利用本机数码测色计,测出导航栏颜色的rgb,再次设置导航栏的颜色和下面view的背景颜色。

3.去除导航栏下面的灰色分割线

  [ self . navigationController . navigationBar setBackgroundImage :[[ UIImage alloc ] init ] forBarMetrics : UIBarMetricsDefault ];

  [ self . navigationController . navigationBar setShadowImage :[[ UIImage alloc ] init ]];

  


去掉导航栏的边界灰线

 [ self . navigationController . navigationBar setBackgroundImage :[[ UIImage alloc ] init ] forBarMetrics : UIBarMetricsDefault ];

self . navigationController . navigationBar . shadowImage = [[ UIImage alloc ] init ];

去掉搜索框的边界黑线

[ self .mySearchBar setBackgroundImage:[[UIImage alloc] init]];

去掉搜索框的文本输入框的阴影

在stroryboard中:选中搜索框——>右边in attribute inspector——>View 在Tint的颜色栏中选择 clear color



版权声明:本文为博主原创文章,未经博主允许不得转载。

原文:http://blog.csdn.net/lijuan3203/article/details/47837899


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!