这是我的列表视图
<ListView android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/ListView"
android:fastScrollEnabled="true" android:divider="@null"
style="@drawable/listviewfastscrollstyle"
></ListView>
这是listviewfastscrollstyle样式文件
<style>
<item name="android:fastScrollTrackDrawable">@drawable/listselector</item>
<item name="android:fastScrollThumbDrawable">@drawable/listselector</item>
</style>
这是列表选择器文件
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/channelarrows_down" />
<item android:drawable="@drawable/minimize" />
</selector>
但列表视图快速滚动条仍然没有得到定制。
您创建的样式不正确。你需要给它一个名字。我不确定你上一篇关于此事的帖子发生了什么。请执行下列操作:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="listviewfastscrollstyle" parent="android:Theme">
<item name="android:fastScrollTrackDrawable">@drawable/listselector</item>
<item name="android:fastScrollThumbDrawable">@drawable/listselector</item>
</style>
</resources>
在你的清单中设置这样的样式:
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/CustomTheme">
根据要求,这是我正在测试的 ListView:
<ExpandableListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:drawSelectorOnTop="false"
android:fastScrollAlwaysVisible="true"
android:fastScrollEnabled="true"
android:indicatorLeft="8dip"
android:indicatorRight="52dip"
android:paddingRight="32dip" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)