开发者

how can i add scroll bar in grid view?

I want to add scroll bar in gridview,How can i add scroll b开发者_如何学Pythonar in grid view?


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.


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜