Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android index scrolling

Tags:

android

scroll

http://developer.android.com/design/building-blocks/scrolling.html

I'm looking for solution to perform the second part ("Index Scrolling"), but I can't find any examples to do that. Is there a solution in default-API?

like image 254
user1049280 Avatar asked Jul 30 '12 07:07

user1049280


People also ask

What is scroll view Android?

In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it.

How to add scroll view in Android studio?

To add multiple views within the scroll view, make the direct child you add a view group, for example LinearLayout , and place additional views within that LinearLayout. Scroll view supports vertical scrolling only. For horizontal scrolling, use HorizontalScrollView instead.

Is CardView scrollable?

Display scrollable content in your Android app using CardView and ScrollView layouts. Card-based layouts are a great way of content in a stylistically consistent manner. For example, you could use card-based layouts to show the images in an image gallery or previews of news articles.


1 Answers

To implement index scrolling, you have to call setFastScrollEnabled(true) on your ListView. In addition, your adapter has to implement the SectionIndexer interface.

You can find an example here: http://spinettaro.blogspot.de/2011/11/android-snippet-code-android-listview.html

This should work with all Views that are a subclass of AbsListView.

like image 167
Sun Avatar answered Nov 12 '22 03:11

Sun