【问题标题】:XCode 7 with iOS 9.3 - Constraints Works in iPhones Simulator But When Running in an iPad Simulator a Margin is Added带有 iOS 9.3 的 XCode 7 - 约束在 iPhone 模拟器中有效,但在 iPad 模拟器中运行时会添加边距
【发布时间】:2016-10-06 12:10:42
【问题描述】:

我正在创建一个非常简单的项目,但我无法让约束在 iPhone 和 iPad 中完美运行,当我在 iPad 模拟器中执行应用程序时会出现这种奇怪的行为(下图)。

我了解到 iphone 和 ipad 之间的边距存在一些差异,即使我试图寻求帮助,我也无法弄清楚如何解决这个问题。

问题似乎出在 View Margins 中......我试图将此代码放在我的 appDelegate 中:

UITableViewCell.appearance().preservesSuperviewLayoutMargins = true
UITableViewCell.appearance().contentView.preservesSuperviewLayoutMargins = true

我在此链接中创建的 UITableViewCell with autolayout left margin different on iPhone and iPad

但是没有用!

在此先感谢您的帮助。

【问题讨论】:

    标签: ios iphone swift ipad ios-simulator


    【解决方案1】:

    愚蠢的错误,我没有将设备设置为通用。

    【讨论】:

      猜你喜欢
      • 2016-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-24
      • 2018-06-29
      • 1970-01-01
      • 2011-02-16
      • 2020-03-08
      相关资源
      最近更新 更多