gpt4 book ai didi

autolayout - 考虑到 iPhone X 设计时避免对称安全区域

转载 作者:行者123 更新时间:2023-12-05 04:08:57 27 4
gpt4 key购买 nike

思考横向拿着 iPhone X。

由于安全区域看起来是对称的,所以安全区域的插入在左侧和右侧一样大,无论缺口在哪一侧。

假设我们希望将安全区域进一步延伸到没有凹口的那一侧的屏幕边缘。有人对此有好的方法吗?我假设我们想要一些与自动布局一起工作的东西。

enter image description here

这里的槽口在左侧。我们希望另一边的边距更小,因为感觉我们可以在那里显示更多内容。

最佳答案

虽然可以这样做,但 Apple 建议您不要在他们的 Human Interface Guidelines 中这样做。 :

Inset essential content to prevent clipping. In general, content should be centered and symmetrically inset so it looks great in any orientation and isn't clipped by corners or the device's sensor housing, or obscured by the indicator for accessing the Home screen. For best results, use standard, system-provided interface elements and Auto Layout to construct your interface. All apps should adhere to the safe area and layout margins defined by UIKit, which ensure appropriate insetting based on the device and context. The safe area also prevents content from underlapping the status bar, navigation bar, toolbar, and tab bar.

就是说 - 我完全理解想要使用额外的空间!

在试图理解 HIG 的这一部分时,让我们这样说:如果您有一款正在横屏观看的游戏,控件应该是对称的,以便用户是否在 landscapeLeftlandscapeRight,按钮内嵌相同的量。如果您不对称地实现控件,那么用户的肌肉内存将不会在一个方向与另一个方向上匹配。

您可以在 2017 年秋季标题为 "Designing for iPhone X" 的 WWDC 视频中听到 Mike Stern(Apple 的设计布道师)谈论这个概念. (此链接有一个时间戳,Mike 在其中详细讨论了景观对称性。)

关于autolayout - 考虑到 iPhone X 设计时避免对称安全区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46972733/

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