简体   繁体   English

自定义UITableViewController单元格不会自动分配

[英]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.

相关问题 UITableViewController中的多个自定义原型单元格 - Multiple Custom Prototype Cells in UITableViewController UITableViewController不显示自定义原型单元格 - UITableViewController not Displaying Custom Prototype Cells UITableViewController不使用Xib文件加载自定义单元格 - UITableViewController not loading custom cells using xib file 具有自定义数据源的UITableViewController不显示单元格 - UITableViewController with custom data source not showing cells UITableView上的某些单元格不会自动调整大小 - Some Cells on UITableView won't auto-resize 如果出现键盘,UITableViewController将不会滚动 - UITableViewController won't scroll if keyboard appears UITableViewController不会执行UIDeviceOrientationPortraitUpsideDown方向 - UITableViewController won't do UIDeviceOrientationPortraitUpsideDown orientation UITableViewController不会使用NSFetchedResultsControllerDelegate + UISearchBarDelegate更新 - UITableViewController won't update with NSFetchedResultsControllerDelegate + UISearchBarDelegate 使用从Storyboard定义的自定义UITableViewController和Prototype单元进行随机UI更新 - Random UI updating with custom UITableViewController and Prototype cells defined from Storyboard 无法在UITableViewController内加载自定义UITableViewCell - Can't load a custom UITableViewCell inside a UITableViewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM