How to improve the performance of TableView

Source: Internet
Author: User

A. Reusing cells

We all know that it takes time to apply for memory, especially in the case of frequent application of memory over a period of time, and in most cases the layout of the cell is the same in Tebleview, and we can improve performance by recycling the reuse mechanism.

  b, avoid the re-layout of content

Try to avoid the re-layout of the cell when the cell is being reused, and the cell is generally well-arranged when the cell is created.

  C, the use of opaque subview

When customizing the cell, setting the subview that will be added to opaque can greatly reduce the time required for multiple view cascade overtime rendering.

  D, if convenient, the DrawRect method of directly overloading Subview

  If you need multiple small elements in the process of customizing a cell, it is best to draw directly on multiple items to be displayed instead of adding multiple subview.

  E, TableView of the delegate method if not necessary, try not to achieve

Many of the functions in TableView's delegate provide further control over the cell properties, such as the height of each cell, whether the cell can be edited, the edit style supported, and so on, as it is not necessary to implement these methods, because fast invocation of these methods can also affect performance.

How to improve the performance of TableView

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.