如何设置标签栏背景图像以清除图像

问题描述 投票:1回答:1

我想将标签栏图像设置为清晰的img,没有任何颜色或任何背景,只显示了标签栏底部,我尝试了很多代码,但仍显示白色背景

这是我在appdelegate中的代码

        UITabBar.appearance().shadowImage = UIImage()
        UITabBar.appearance().barTintColor = UIColor.clear
        UITabBar.appearance().tintColor = UIColor.HalaColor
        UITabBar.appearance().layer.borderWidth = 0.50
        UITabBar.appearance().clipsToBounds = true
swift xcode image uitabbar tabbar
1个回答
2
投票

通过以下几行,您应该获得想要的效果:

UITabBar.appearance().barTintColor = UIColor.clear
UITabBar.appearance().shadowImage = UIImage()
UITabBar.appearance().backgroundImage = UIImage()
© www.soinside.com 2019 - 2024. All rights reserved.