gpt4 book ai didi

ios - 如何在 iOS 中获取安全区域的顶部、底部、右侧、左侧值?

转载 作者:IT王子 更新时间:2023-10-29 07:55:46 27 4
gpt4 key购买 nike

Xcode iOS如何获取安全区域的top,bottom,right,left值像这样 -> How to get height of topLayoutGuide?

// Inside your viewController
self.topLayoutGuide.length

最佳答案

安全区域插图是一个 UIEdgeInsets 结构。您可以像这样访问组件:

 view.safeAreaInsets.left
view.safeAreaInsets.right
view.safeAreaInsets.top
view.safeAreaInsets.bottom

等等

关于ios - 如何在 iOS 中获取安全区域的顶部、底部、右侧、左侧值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46201174/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com