开发者

Width of a scroll bar in android

In my application sc开发者_高级运维roll bar is just too skinny to use. Does anyone know how to change the width of this?


Looking around in the platform resource files, I found this in res/values/themes.xml under the main Theme:

    <item name="scrollbarSize">10dip</item>
    <item name="scrollbarThumbHorizontal">@android:drawable/scrollbar_handle_horizontal</item>
    <item name="scrollbarThumbVertical">@android:drawable/scrollbar_handle_vertical</item>

So, it looks like if you create your own Theme, as described in the documentation, you can provide your own drawables for the scrollbars.

I do wonder what you mean by they are "too skinny to use". They aren't meant to be touched/dragged. They are meant for display, to show you your current position relative to the entire ScrollView.


Instead of creating your own theme dedicated to your ScrollView, you can set the android:scrollbarSize attribute.

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scrollbarSize="2dp" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜