这不是一个问题,而是我面临的问题的解决方案.
在Xcode 7中,当应用程序在iPad设备上的iOS 9上运行时,UITableView单元格会在tableview的左侧留下一些边距.将设备旋转到横向会增加边距.
我找到的解决方案是:
将"cellLayoutMarginsFollowReadableWidth"设置为NO.
self.tbl_Name.cellLayoutMarginsFollowReadableWidth = NO;
Run Code Online (Sandbox Code Playgroud)
因为,此属性仅在iOS 9中可用.因此,您必须设置条件来检查iOS版本,否则它将崩溃.
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_8_1)
{
self.tbl_Name.cellLayoutMarginsFollowReadableWidth = NO;
}
Run Code Online (Sandbox Code Playgroud)
希望它对其他人有所帮助.