Android ListView滚动条
我创建了一个列表视图。我需要增加垂直滚动条的宽度。我改变了android:scrollbarSize。但它不工作。还想减少滚动条拇指的长度。是否可行。请帮帮我Android ListView滚动条,android,listview,scrollbar,Android,Listview,Scrollbar,我创建了一个列表视图。我需要增加垂直滚动条的宽度。我改变了android:scrollbarSize。但它不工作。还想减少滚动条拇指的长度。是否可行。请帮帮我 <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ListView
android:id="@+id/list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollX="0px"
android:scrollY="0px"
android:background="#515151"
android:layout_weight="1"
android:scrollbarStyle="outsideOverlay"
android:divider="#FFF"
android:fadeScrollbars="false"
android:scrollbarSize="20dip"/>
</LinearLayout>
我问了同样的问题,但没有得到任何回答: 然后,有一个问题打开了,但关闭了它,声明“按预期工作”:
到目前为止,我还没有看到一个解决方案,尽管我还没有做太多的研究。如果您找到任何解决方案,请更新此问题。您的滚动条将缩放到为
android:scrollbarTrackHorizontal
和android:scrollbarTrackVertical
指定的资源的宽度/高度
这似乎是我现在能想出的唯一办法,我不会再胡闹了;)
所以如果你想要一个8px宽的水平轨道,和一个12px高的垂直轨道。为水平轨迹创建8px宽的PNG。为水平轨迹创建一个12px高的PNG。android:scrollbarThumbHorizontal和android:scrollbarThumbHorizontal的九个补丁将在这些图像中自动缩放
<item name="android:scrollbarTrackHorizontal">@drawable/png_12px_high</item>
<item name="android:scrollbarTrackVertical">@drawable/png_8px_wide</item>
@drawable/png\u 12px\u高
@可拉伸/png_8px_宽
您可以发布布局文件吗?将布局放入代码中。。。请检查ittry设置android:layout\u width=“wrap\u content”我不能使用wrap\u content。因为我在对话框中使用列表视图,该列表视图应该会填充对话框。是否有任何解决方案?请在此处发布以帮助我。