简体   繁体   中英

Programmatically scroll ListView

I have an activity which consists of a ListView . The problem is that the background color of the activity is the same color as the ListView (whithin that activity), what causes a lot of users to miss the fact that they are able to scroll the list.

I want to achieve an effect on which when the activity loads, I will programmatically scroll the list for a few milliseconds and scroll back, so the user will understand it is scrollable.

Can it be done? (API 7)

Instead of scrolling, what about just always showing the Scrollbars?

In your XML (can't find the docs for this, but it shows up in Eclipse as a Property under "Fade scrollbars"):

android:fadeScrollbars="false"

Or if you need / want to do it programatically, you can use setScrollbarFadingEnabled() :

yourView.setScrollbarFadingEnabled(false);

I would consider auto scrolling of the app somewhat distracting, but having the scrollbar visible is what users are accustomed to from the web.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM