在iOS7中删除UITabBar水平分隔符 [英] Remove UITabBar horizontal separator in iOS7

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

问题描述

我想删除UITabBar和屏幕其余部分之间的水平分隔线。我问的是和这个人一样的问题,但是针对iOS7进行了更新。

I want to remove the horizontal separator line between a UITabBar and the rest of the screen. I'm asking the same question as this guy but updated for iOS7.

设置UITabBar的背景图像并不能解决问题,也不会设置 [UITabBar外观]的背景图像 object。

Setting the background image of my UITabBar doesn't alleviate the problem, nor does setting the background image of the [UITabBar appearance] object.

在iOS7中这仍然可以吗?如果是这样,怎么做?

Is this still possible in iOS7? If so, how?

推荐答案

这个问题的答案与删除导航栏或工具栏的分隔符非常相似。

The answer to this is pretty much the same as removing the separator of a navigation bar or a toolbar.

官方说明,只有将shadowImage设置为空图像才能实现。但是,仔细看看文档,我们看到:

Officially, this is only possible by setting the shadowImage to an empty image. However, a closer look at the documentation, we see that:


要显示自定义阴影图像,自定义背景图片必须使用backgroundImage属性设置
。如果使用默认的
背景图像,则默认阴影图像将使用
,无论此属性的值如何。

For a custom shadow image to be shown, a custom background image must also be set using the backgroundImage property. If the default background image is used, then the default shadow image will be used regardless of the value of this property.

通过使用自定义背景图像,您将失去模糊的背景半透明效果。

By using a custom background image, you would lose the blurred background translucency.

分隔符是UIImageView,它是标签栏的子视图。您可以在选项卡栏的层次结构中找到它并将其设置为隐藏。

The separator is a UIImageView that is a subview of the tab bar. You can find it in the tab bar's hierarchy and set it to hidden.

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

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