本文介绍了如何删除UINavigatonItem的边框线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以删除UINavigationItem的边框?我在黑色导航下的观点。酒吧是黑色的,我不希望他们之间没有视觉边界。

Is it possible to remove UINavigationItem's border? My view under black nav. bar is black and i don't want no visual border between them.

为了更清晰(图片不是来自我的应用):

To make it clearer (image is not from my app):

推荐答案

你可以't 隐藏它。您可以添加掩盖它的子视图。示例:

You can't hide it. You can add a subview that will mask it. Example:

UIView *overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 43, 320, 1)];
[overlayView setBackgroundColor:[UIColor whiteColor]];
[navBar addSubview:overlayView]; // navBar is your UINavigationBar instance
[overlayView release];

我没有检查,但它应该有用。

I didn't check it, but it should work.

编辑:我查了一下,确实有效。

I checked it, it works.

这篇关于如何删除UINavigatonItem的边框线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 17:21