eggswift / ESTabBarController

:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie!
MIT License
5.17k stars 578 forks source link

在iOS13 上 tabbar 上面有一条黑线 #215

Closed findM closed 4 years ago

findM commented 4 years ago

在iOS13 上 tabbar 上面有一条黑线

HelloHchen commented 4 years ago

tabbar 不是自带黑线么 ?

bymax commented 4 years ago

我也想问,在iOS13 Tabbar怎么去除自带黑线,怎么设置背景透明,iOS11 ,12是没问题的,13怎么设置都不行

HelloHchen commented 4 years ago

tabBar去除黑线可以再 tabbar的 index 0添加一个 visualeffectview (height>tabBar高度)这样既保留了毛玻璃效果,也能藏掉黑线,同时也可以在 visualEffectView上添加自定义的阴影。注意 iOS13 开启深色模式后会影响 blureffect 的颜色,需要实现方法监听模式改变去更改换色

Alvazz commented 4 years ago

mark

zhuangxq commented 4 years ago

可解iOS13 黑线问题:

if #available(iOS 13, *) {
    let appearance = self.tabBar.standardAppearance.copy()
    appearance.shadowImage = UIImage()
    appearance.shadowColor = .clear
    self.tabBar.standardAppearance = appearance
} else {
    self.tabBar.shadowImage = UIImage()
    self.tabBar.backgroundImage = UIImage()
}
HelloHchen commented 4 years ago

测不测就敢贴代码?

zhuangxq commented 4 years ago

测过了兄弟

HelloHchen commented 4 years ago

你试试10系统再