滚动条在ListView ...定制它。 [英] scrollBar in a listView...customizing it.
本文介绍了滚动条在ListView ...定制它。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法来定制的标准滚动条的ListView控件提供的Android ..?我没有得到这个确切的答案尚未:/
Is there a way to customize the standard scrollbar that ListView provides in android..? I haven't got a definitive answer on this yet :/
推荐答案
在创建一个主题 RES / styles.xml
:
<style name="CustomTheme" parent="android:Theme">
<item name="android:scrollbarTrackVertical">@drawable/scroll_track</item>
<item name="android:scrollbarThumbVertical">@drawable/scroll_thumb</item>
</style>
@绘制/ scroll_track
和 @绘制/ scroll_thumb
必须是指无论是九片图像或形状可绘。滚动轨道的图像是背景的滚动条。滚动拇指负责滚动柄。然后,只需应用的主题无论是整个应用程序或在AndroidManifest.xml中的活动:
@drawable/scroll_track
and @drawable/scroll_thumb
must refer either to nine patch images or to a shape drawables. Scroll track image is a background for the scroll bar. Scroll thumb is responsible for the scroll handle. Then just apply the theme either to whole application or to an activity within AndroidManifest.xml:
<application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/CustomTheme">
这篇关于滚动条在ListView ...定制它。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文