【发布时间】:2012-12-26 14:55:51
【问题描述】:
关于我的应用
我有一个具有全息外观的应用程序。
对于 Honeycomb 之前的设备,我只是向后移植了 Holo 主题的一些元素。
CheckBox、RadioButton 可以使用主题、样式和属性...
我想要做什么
我使用ListView 来显示很多项目。我想在我的ListView 上启用快速滚动,并且我希望它具有全息外观。
我的问题
我在将快速滚动Drawable 集成到我的应用主题中时遇到了一些困难。
到目前为止我已经尝试过什么
正在寻找执行此操作的库。 HoloEverywhere 是 有希望但没有处理。
自己尝试过:
我刚刚添加了那些可绘制对象:
然后还添加了这个drawable:
<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:fastScrollThumbDrawabledoesn't exist pre-honeycomb。
希望你能帮我解决这个问题。 :)
更新:
几个小时前,HoloEverywhere 似乎添加了快速滚动支持:
https://github.com/ChristopheVersieux/HoloEverywhere/commit/34561e48339bf6a3e0307d2d35fc4c5ac8409310
我会检查一下。 :)
【问题讨论】:
-
HoloEverywhere 解决了您的问题吗?
-
我没有尝试将 HoloEverywhere 集成到我的应用程序中,但如果所有者接受了拉取请求,那么它肯定可以工作。我看了看他们是怎么做的,看起来很重。对我来说太多了,无法将它集成到我的应用中。
标签: android android-layout android-theme android-holo-everywhere fastscroll