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

iPhoneX上,只在demo上,加上文字,就显示不正常 #270

Open zzdota opened 2 years ago

zzdota commented 2 years ago

image 有没有办法,解决这个问题?

解决办法,如下 image

解决后的效果如下,希望能帮到遇到同样困扰的小伙伴们,好运 image

    /// 底部安全区高度
     func safeDistanceBottom() -> CGFloat {
        if #available(iOS 13.0, *) {
            let scene = UIApplication.shared.connectedScenes.first
            guard let windowScene = scene as? UIWindowScene else { return 0 }
            guard let window = windowScene.windows.first else { return 0 }
            return window.safeAreaInsets.bottom
        } else if #available(iOS 11.0, *) {
            guard let window = UIApplication.shared.windows.first else { return 0 }
            return window.safeAreaInsets.bottom
        }
        return 0;
    }