【发布时间】: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