Listview optimization scheme

Source: Internet
Author: User

1. If the custom adapter is used, check whether the contentview parameter passed in by the method is null in the getview method. If it is null, create the contentview and return it, if it is not null, use it directly. Create as few views as possible in this method.

2. Set tag (settag () for contentview and input a viewholder object to cache the data to be displayed, so that the image data can be asynchronously loaded.

3. If the listview needs to display a large number of items, it is necessary to consider paging loading. For example, if you want to display a total of 100 or more items, we can consider loading 20 items first and loading the next 20 items when the user pulls them to the bottom of the list.

Listview optimization scheme

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.