How to Improve tableView performance and tableView Performance

Source: Internet
Author: User

How to Improve tableView performance and tableView Performance

A. Reuse cell

We all know that it takes time to apply for memory, especially frequent memory application within a period of time will cause a great deal of overhead, and the cell layout is the same in most cases in tebleView, at this time, we can improve the performance through the recycling mechanism.

B. Avoid re-layout of content

Try to avoid re-layout the cell when reusing the cell. Generally, the cell is well laid out when the cell is created.

C. Use an opaque subView

When customizing the cell, setting the subView to be added to an opaque state will greatly reduce the time required for rendering when multiple view layers are stacked.

D. If convenient, directly reload the drawRect method of subView.

If multiple small elements are required during cell customization, it is best to draw multiple projects to be displayed directly, instead of adding multiple subviews.

E. do not implement the delegate method of tableView unless necessary.

Many delegate functions in tableView further control cell attributes, such as the height of each cell, whether the cell can be edited, and the supported edit style, if not necessary, it is best not to implement these methods because the quick call of these methods will also affect the performance.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.