如何减小 UITableViewCell 中 ContentSize 的宽度

How Reduce the Width of ContentSize in UITableViewCell

如何缩小 contentSize 宽度 UITableViewCell

-> 我在 UITableView 属性 中尝试过,但是有选项可以减少高度的 UITableViewCell contentSize,但不能减少宽度。

-> 我想减少 UITableView 中的 UITableViewCell contentSize 宽度。

您不能使用单元格 属性 减小单元格宽度。您需要更改 UITableView 框架大小。设置你想要设置的宽度。

// MyCustomUITableViewCell.m - (void)layoutSubviews {

self.bounds = CGRectMake(self.bounds.origin.x,self.bounds.origin.y,self.bounds.size.width - 50,self.bounds .size.height);

[super layoutSubviews];

} http://natashatherobot.com/ios-frame-vs-bounds-resize-basic-uitableview-cell/'