Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zzdota opened this issue Apr 25, 2022 · 0 comments
Open

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

zzdota opened this issue Apr 25, 2022 · 0 comments

Comments

@zzdota
Copy link

zzdota commented Apr 25, 2022

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;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant