In iPAD, when you create a new UITableViewCell, the width of the contentView is set to 320. Is there a way to get the desired width? I cannot use the width of the current view, since the table cells do not cover the entire width of the view. Any help would be greatly appreciated.
- (void)layoutSubviews { [super layoutSubviews]; CGFloat viewWidth = self.contentView.frame.size.width;
This gives the correct width for the contentView . If [super layoutSubviews] not called initially, then the contentView frame contentView set incorrectly.
contentView
[super layoutSubviews]
I solved this problem using:
cell.contentView.frame = CGRectMake(cell.contentView.frame.origin.x, cell.contentView.frame.origin.y, self.tableView.frame.size.width, cell.contentView.frame.size.height);