如何创建具有分组样式的UITableView,以使单元格的宽度与表视图的宽度不同?

例如,表格视图的宽度为768(iPad宽度),但我希望单元格只有500宽。

最佳答案

middaparka在评论中说的话,其父视图的背景颜色与uitable视图的颜色相同:

myTableView.superview.backgroundColor = myTableView.backgroundColor;
// Not tested, should work though.

07-26 09:42