简体   繁体   中英

Are UIView's in TableViewCells cause for performance problems?

I have a UITableView of UITableViewCells that so far performed well. I now aded a simple UIView to my UITableViewCell as a color indicator (backgroundColor only, no other content or attributes).

Running the tableview again I realise scrolling is not as smooth as it used to be. The tableView suddenly also takes long time (~1+ secs) to come back again when returning from a subview (eg return from the view that gets pushed upon selection of a cell).

Any ideas why the added UIView would be problematic? Why are the labels (being a subclass of UIView) not cause for similar issues?

I found the cause for this. It had nothing to do with the UIView, but me clearing the buffers of the simulator. This way I also removed some buffered settings. With those ones not missing, the viewWillAppearMethod switched to regeneration and therefore took long time to process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM