sivaraj
sivaraj

Reputation: 1867

how can i add scroll bar in grid view?

I want to add scroll bar in gridview,How can i add scroll bar in grid view?

Upvotes: 0

Views: 3647

Answers (2)

CommonsWare
CommonsWare

Reputation: 1007369

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.

Upvotes: 4

Teja Kantamneni
Teja Kantamneni

Reputation: 17482

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>

Upvotes: -1

Related Questions