I want to change the width of the cell content. (see the pic)
My code:
CGSize contentViewSize = cell.contentView.bounds.size;
contentViewSize.width = 20.0f;
But there is no effect, what's wrong?
Any suggestion will be appreciated, thanks.
I want to change the width of the cell content. (see the pic)
My code:
CGSize contentViewSize = cell.contentView.bounds.size;
contentViewSize.width = 20.0f;
But there is no effect, what's wrong?
Any suggestion will be appreciated, thanks.
You need to re-assign the frame
for the cell's contentView
.
CGRect oldFrame = cell.contentView.frame;
cell.contentView.frame = CGRectMake( oldFrame.origin.x,
oldFrame.origin.y,
oldFrame.size.width + 20,
oldFrame.size.height );