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

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

问题描述

我已经包含了对导航栏 (navigationController) 的需求,该导航栏 (navigationController) 与栏 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 中试过这个:

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]];

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

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