开发者

Reuse the uitableview cell as well as the subview in the cell

Developers, I have added uitextviews as a subviews in uitableviewcell. I have about 4 columns and 30 rows in custom cell. Now the problem is that i have to alloc everytime new uitextview , tha开发者_高级运维ts why scrolling of tableview have become very slow, cells take so much time to load. Can anyone tell me how can i alloc my textview only once and reuse that for other cells also.


If you create a custom subclass of UITableViewCell, it is possible to queue/dequeue cell that have a UITextField. You should be able to reset your textview using the following method:

- (void)prepareForReuse; 

It is normal for a program to have multiple different subclass of a UITableViewCell. This is one of the most subclassed object in UIKit

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜