赞
踩
想要实现上面这种界面,一般都会显示的与预期的不一致,尽管我们设置的颜色是一样。通过下面的步骤就可以实现:
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。