【发布时间】:2011-02-07 00:36:50
【问题描述】:
我正在尝试修改 ListView 滚动条的宽度,但没有成功
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:choiceMode="singleChoice"
android:scrollbars="vertical"
android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track"
android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"
android:scrollbarSize="4px"
android:clickable="true"/>
首先我尝试使用 4px 宽的可绘制图像,但 .png 已调整大小。然后我尝试使用从 SamplesApi 中提取的形状,但没有成功。
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40px">
<gradient android:startColor="#505050" android:endColor="#C0C0C0"
android:angle="0"/>
<corners android:radius="0dp" />
我尝试过使用和不使用 android:width 属性。
有一个关于同一主题的问题 (Width of a scroll bar in android),但它并没有尝试任何与我已经尝试的不同的东西。据我所知,创建自己的主题不应该改变输出。
SamplesApi (Views/ScrollBars) 中有一个示例。我尝试修改 scrollbarSize 属性没有结果。
我知道 Ninepatch 图像,但有一个属性可以满足我的需求。
有什么提示吗?提前致谢。
【问题讨论】:
标签: android listview scrollbar