Sunday, January 19, 2014

android Listview scrollto problem


            
After calling scrollto listview functions, data displayed list is missing.
Example: There are six list item, listview can display 4, when scrollto call function
After making a list scrolling, only to see the item before 5
Reply:
Commissioning found 5 is able to accommodate the height of the current listview number, is actually four all to see, the first five have a little look less out
Reply:
Ask what you in the end? To achieve what effect? ScrollTo must use this function?

Reply:
Do not use this method, smoothScrollToPosition or smoothScrollBy, anyway, is smoothScroll begin with, according to your needs to be.
Reply:
My display area only shows 4 records, listview total more than four records;
The first record of the first color set into other colors, a certain time interval set the second record, and then click Settings to
All records are complete.

Article 5 record set when to see it, so I want to use the scroll function

Set the color used is ListView.getChildAt (i). FindViewById (R.id.id)

Now found getChildAt get item is currently visible area of ​​the first few, but let it slip after ListView, set a good item
Changed again
Reply:
references, 4th Floor u010082177 reply:
my display area can only display four records, listview a total of more than four records;
The first record of the first color set into other colors, a certain time interval set the second record, and then click Settings to
All records are complete.

Article 5 record set when to see it, so I want to use the scroll function

Set the color used is ListView.getChildAt (i). FindViewById (R.id.id)

Now found getChildAt get item is currently visible area of ​​the first few, but let it slip after ListView, set a good item
Changed again

With smoothScroll not?
Reply:
references, 4th Floor u010082177 reply:
my display area can only display four records, listview a total of more than four records;
The first record of the first color set into other colors, a certain time interval set the second record, and then click Settings to
All records are complete.

Article 5 record set when to see it, so I want to use the scroll function

Set the color used is ListView.getChildAt (i). FindViewById (R.id.id)

Now found getChildAt get item is currently visible area of ​​the first few, but let it slip after ListView, set a good item
Changed again


Yeah sure, you can only get with getChildAt method displays the item, you want to override getView method

All item are redrawn using the method getViewGetView method to set the background in which to write like
You see my blog, have similar code can give you a reference
Reply:
Thank you for sharing experiences

No comments:

Post a Comment