Best Practices: Fast UITableView Scrolling?

无人久伴 提交于 2020-02-03 02:10:15

问题


I know there has been a lot of discussion around fast scrolling. Apple provides excellent examples:

http://developer.apple.com/library/ios/#samplecode/TableViewSuite/Introduction/Intro.html

I will have a custom UITableViewCell that has 2 UIImageView's and 3 UILabels as subviews. If I just add them as subviews to the content view will my scrolling be slow?

Would it be best to just draw these?


回答1:


The answer I got from the UIKit guys at WWDC this year was "it kinda depends on what you're doing". If everything in the cell is opaque and simple, adding subviews directly to the content view is very performant. If you need some views to have varying opacity or changes, rendering it manually can be faster.

The videos for WWDC were just posted, I recommend you watch session 105 (second half specifically), it addresses analyzing and improving performance in UITableView, in a real world app.



来源:https://stackoverflow.com/questions/6462460/best-practices-fast-uitableview-scrolling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!