水平分隔符NavBar IOS 7 [英] Horizontal Separator NavBar IOS 7

查看:109
本文介绍了水平分隔符NavBar IOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经包含了一个navbar(navigationController)的需要,它与bar viewController的背景颜色相同......现在我有一个问题......在导航栏和视图之间我有一条水平线将它们分开,你可以从图片中看到..你能告诉我如何删除这条水平黑色并使其更加一致?

I have included the need for a navbar (navigationController) with the same tint of the background of the bar viewController ... Now I have a problem ... Between the navbar and the view I have a horizontal line that separates them, as you can see from the picture .. Can you tell me how can I delete this line horizontal black and make it more consistent?

我在AppDelegate中试过这个: / p>

I tried this in AppDelegate:

[[UINavigationBar appearance] setShadowImage: [[UIImage alloc] init]];

     UINavigationController * nav = (UINavigationController *) self.window.rootViewController; nav.navigationBar.translucent = NO;

但我没有得到结果。你能帮我吗?感谢Rory的所有人。

But I did not get results. Can you help? Thanks to all of Rory.

推荐答案

您还必须为导航栏设置背景图像以满足您的要求

You also have to set background image for navigation bar in order to achieve your requirement

[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];

这篇关于水平分隔符NavBar IOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆