Skip to content

Most visited

Recently visited

navigation
added in version 24.1.0
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

ListViewCompat

public final class ListViewCompat
extends Object

java.lang.Object
   ↳ android.support.v4.widget.ListViewCompat


Helper for accessing features in ListView

Summary

Public methods

static boolean canScrollList(ListView listView, int direction)

Check if the items in the list can be scrolled in a certain direction.

static void scrollListBy(ListView listView, int y)

Scrolls the list items within the view by a specified number of pixels.

Inherited methods

From class java.lang.Object

Public methods

canScrollList

added in version 26.1.0
boolean canScrollList (ListView listView, 
                int direction)

Check if the items in the list can be scrolled in a certain direction.

Parameters
listView ListView

direction int: Negative to check scrolling up, positive to check scrolling down.

Returns
boolean true if the list can be scrolled in the specified direction, false otherwise.

scrollListBy

added in version 24.1.0
void scrollListBy (ListView listView, 
                int y)

Scrolls the list items within the view by a specified number of pixels.

Parameters
listView ListView: the list to scroll

y int: the amount of pixels to scroll by vertically

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)