Open zzdota opened 2 years ago
有没有办法,解决这个问题?
解决办法,如下
解决后的效果如下,希望能帮到遇到同样困扰的小伙伴们,好运
/// 底部安全区高度 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; }
解决办法,如下![image](https://user-images.githubusercontent.com/16704305/165044190-45517199-ea68-4536-9b2d-0b67a3bcfd62.png)
解决后的效果如下,希望能帮到遇到同样困扰的小伙伴们,好运![image](https://user-images.githubusercontent.com/16704305/165044318-58735af9-13f3-41e2-829f-27c1b4f74eea.png)