开发者

Is it possible to edit numberOfLines of UITableViewCell?

Is it possible to edit numberOfLines of UITableViewCell when click on that cell? possible?

example

cell.textLabel.numberOfLines = 1;

when selected at cell

cell.textLabel.numberOfLines = 5;
开发者_运维技巧

thanks for all reply


You still have the issue of the cell row height not being able to dynamically resize because it is set at the time of cell creation. (via heightForRowAtIndexPath)

Oddly enough if you want to determine the size for the text in that text label the best way to do it is with NSString's sizeWithFont.


I think you also need to set the frame of label

CGRect rect=cell.textLabel.frame;
rect.size.height=(5*rect.size.height);
cell.textLabel.frame=rect;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜