关于我的应用
我有一个使用Holo主题的应用。
对于早期的设备,我只是回溯了一些Holo主题的元素。
对于CheckBox、RadioButton等工作主题、样式和属性都可以正常使用。
我的目标
我使用ListView来显示大量项目。我想在我的ListView上启用快速滚动,并希望它具有Holo外观。
我的问题
我在将快速滚动Drawable集成到我的应用程序主题中时遇到了一些困难。
我已经尝试过的方法
寻找可以完成此任务的库。 HoloEverywhere很有希望,但没有处理该问题。
尝试自己实现:
我只需添加这些可绘制对象:
然后还添加了此可绘制对象:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/fastscroll_thumb_pressed_holo" />
<item android:drawable="@drawable/fastscroll_thumb_default_holo" />
</selector>
在我的
attrs.xml
中新增了以下内容:<attr name="fastScrollThumbDrawable" format="reference" />
我在我的
themes.xml
文件中添加了以下内容:
<style name="MyTheme">
<item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_holo</item>
</style>
这个主题已经在我的应用程序的
Manifest.xml
文件中正确设置:android:theme="@style/MyTheme"
请记住,
android:fastScrollThumbDrawable
在honeycomb之前是不存在的。 。
我希望你能帮我解决这个问题。 :) 更新: 看起来快速滚动支持已经添加到了HoloEverywhere中,几个小时前:
我会去查看一下。 :)https://github.com/ChristopheVersieux/HoloEverywhere/commit/34561e48339bf6a3e0307d2d35fc4c5ac8409310