I want to add scroll bar in gridview,How can i add scroll bar in grid view?
Asked
Active
Viewed 3,600 times
2 Answers
4
I want to add scroll bar in gridview,How can i add scroll bar in grid view?
GridView already has a scrollbar, so there is nothing that you need to do. In Android 2.2, the bar will only appear by default when the user is actively swiping the grid. There are a series of attributes defined on the View class you can use to tailor the behavior of the scrollbar.
CommonsWare
- 954,112
- 185
- 2,315
- 2,367
-1
Wrap your grid view in a scrollview.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:paddingTop="10dip"
android:paddingLeft="5dip"
android:layout_weight="1"
>
</ScrollView>
Teja Kantamneni
- 17,179
- 11
- 55
- 86
-
2A GridView is basically a ListView with columns. All of the same concepts apply. Putting a ListView or GridView into a ScrollView is like trying to parse HTML with regex. Your only reward for the attempt will be pain and misery. – adamp Sep 08 '10 at 23:06