Android Listview Scrollto problem

Source: Internet
Author: User

============ Problem Description ============


After the ListView invokes the Scrollto function, the list displays data that is missing.
Example: List has 6 items Item,listview can display 4 items when calling Scrollto function
Once the list is scrolled, only the first 5 item is visible

============ Solution 1============


Reference 4 floor u010082177 reply:
My display area can only display 4 records, the ListView has a total of more than 4 records;
First set the color of the first record to a different color, at a certain time the second record, set to
All records are complete.

When I set the 5th record, I can't see it, so I want to use the scroll function

Set the color with Listview.getchildat (i). Findviewbyid (R.id.id)

It is now found that the item Getchildat gets is the first of the currently visible areas, but after the ListView has been slid, set the item
It's changing again.


Yes, you can only get the item displayed by using the Getchildat method, to rewrite the GetView method
All of the item is redrawn using the GetView method.
Set the background and write it in the GetView method.
You see my blog, there is similar code can give you reference

Android Listview Scrollto problem

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.