[英]Custom UITableViewController cells won't auto allign
I have some custom cells in a UITableViewController that I've used constraints to set a label to align to the left margin with aa trailing space of 8 and a switch to align to the right margin, also with a trailing space of 8. This looks great on iPhone, but it does not align properly on iPad. 我在UITableViewController中有一些自定义单元格,我使用约束来设置标签以使其尾部间距为8对齐到左边距,并设置开关以使其右边距也为8尾部对齐。在iPhone上效果很好,但在iPad上无法正确对齐。 Here's what it looks like. 这是它的样子。
iPhone: 苹果手机:
iPad: iPad:
How do you set the margin to automatically change based on the screen size so it doesn't look so weird on iPad? 如何设置边距以根据屏幕尺寸自动更改,以使其在iPad上看起来不那么奇怪?
Absolutely nothing I tried would fix this. 绝对没有,我尝试过可以解决此问题。 It turns out that there must be some bug in iOS9/Xcode 7, because I was only able to fix the issue by downgrading my devices to iOS 8 and Xcode to Xcode 6. 事实证明,iOS9 / Xcode 7中肯定存在一些错误,因为我只能通过将设备降级到iOS 8和将Xcode降级为Xcode 6来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.