如何更改标签栏分隔线?

时间:2022-11-20 21:34:09

There exists a black line which rests on top of all tabbars and you seemingly have three options, remove it, customize it, or keep it.

存在一条黑线,它位于所有标签栏的顶部,您似乎有三个选项,删除它,自定义或保留它。

I already know how to remove it, and for those who are looking at this to find out how to do so the code in Swift is

我已经知道如何删除它,并且对于那些正在查看它的人来说明如何这样做Swift中的代码是

(put in app delegate)

(放入app代表)

    let tabbar = UITabBar.appearance()
    tabbar.shadowImage = UIImage()
    tabbar.translucent = false
    tabbar.backgroundImage = UIImage()

But anyway, I'm curious about the second option, customizing it. I've seen some apps color it and make it a part of their overall theme. I'm curious as to how one can achieve this.

但无论如何,我很好奇第二个选项,定制它。我见过一些应用程序对它进行着色并使其成为整体主题的一部分。我很好奇如何才能实现这一目标。

1 个解决方案

#1


0  

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.

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

#1


0  

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.

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