Change the width of the cell content
I want to change the width of the cell content. (see the pic) alt text http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/Art/tv_cell_pa开发者_运维百科rts.jpg
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 );
精彩评论