【问题标题】:layoutMargins are not consistent across iPhone and iPadlayoutMargins 在 iPhone 和 iPad 上不一致
【发布时间】:2018-11-08 23:55:43
【问题描述】:

iPad 11 英寸

(lldb) po UIApplication.shared.windows[0].layoutMargins
▿ UIEdgeInsets
  - top : 32.0
  - left : 8.0
  - bottom : 28.0
  - right : 8.0

iPad 10.5 英寸

(lldb) po UIApplication.shared.windows[0].layoutMargins
▿ UIEdgeInsets
  - top : 28.0
  - left : 8.0
  - bottom : 8.0
  - right : 8.0

iPhone 8 Plus

(lldb) po UIApplication.shared.windows[0].layoutMargins
▿ UIEdgeInsets
  - top : 8.0
  - left : 8.0
  - bottom : 8.0
  - right : 8.0

新的 11 英寸 iPad 机型由于圆角而具有比 10.5 英寸机型更大的上边距是有道理的。但是为什么 iPad 10.5 英寸机型的上边距不是 8.0 呢? iPhone 在所有边缘都有一致的边距...

有什么想法吗?

【问题讨论】:

    标签: ios12 layoutmargins


    【解决方案1】:

    可能是因为 iPad 启用了状态栏。启用状态栏时我在 10.5 英寸 iPad 上得到你的结果,禁用状态栏时我得到所有 8s。

    我想弄清楚的是,为什么在禁用状态栏的 iPad 11 英寸上,上边距是 8 而不是像底部那样的 28。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-03
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      • 2016-07-01
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多