Extra bottom space/padding on iPhone X?

前端 未结 7 1200
春和景丽
春和景丽 2020-12-13 05:59

On the iPhone X in portrait mode, if you set a bottom constraint to safe area to 0, you will end up with an extra space at the bottom of the screen. How do you get programma

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 06:45

    iOS 11 (a mix from answers above)

    let padding = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0

提交回复
热议问题