Xcode iOS如何获得安全区域的顶部,底部,右侧,左侧值 像这样 - > How to get height of topLayoutGuide?
// Inside your viewController
self.topLayoutGuide.length
答案 0 :(得分:27)
安全区域insets是UIEdgeInsets
结构。您可以访问以下评论:
view.safeAreaInsets.left
view.safeAreaInsets.right
view.safeAreaInsets.top
view.safeAreaInsets.bottom
等