【问题标题】:How can I account for this UI discrepancy between iOS 10 and iOS 11如何解决 iOS 10 和 iOS 11 之间的这种 UI 差异
【发布时间】:2018-07-28 11:00:35
【问题描述】:

第一张图是iPhone 6 Plus iOS 11,第二张图是iPhone 6 Plus iOS 10。为什么状态栏和返回键的距离有出入?我如何在我的代码中解释这一点?

这是代码

[backButton.topAnchor constraintEqualToAnchor:margins.topAnchor constant:5].active = YES;

【问题讨论】:

标签: ios objective-c autolayout ios10 ios11


【解决方案1】:

听起来你需要类似的东西:

[backButton.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor constant: 5.0] 

self 是您在其中显示按钮的视图控制器。

差异来自 Apple 如何更改布局指南以更轻松地考虑导航栏、标签栏、iPhoneX 缺口等。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-03
    • 1970-01-01
    相关资源
    最近更新 更多