Holo快速滚动看旧设备上

Tim*_*nin 8 android android-layout fastscroll android-theme android-holo-everywhere

关于我的应用

我有一个具有全息外观的应用程序.

对于pre-Honeycomb设备,我只是向后推出了Holo主题的一些元素.

使用主题,样式和attrs适用于CheckBox,RadioButton ......

我想做什么

我使用ListView来显示很多项目.我想在我的ListView上启用快速滚动,我希望它具有全息外观.

我的问题

我有一些困难将快速滚动Drawable它集成到我的应用主题中.

到目前为止我尝试过的

  1. 寻找能够做到这一点的图书馆. HoloEverywhere很有希望,但没有处理.

  2. 试图自己做:

我刚刚添加了那些drawable:

在此输入图像描述 在此输入图像描述

然后还添加了这个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>
Run Code Online (Sandbox Code Playgroud)

在我的添加中attrs.xml:

<attr name="fastScrollThumbDrawable" format="reference" />
Run Code Online (Sandbox Code Playgroud)

我在我的中添加了这个themes.xml:

<style name="MyTheme">
    <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_holo</item>
</style>
Run Code Online (Sandbox Code Playgroud)

此主题已正确设置为我的应用程序Manifest.xml:

android:theme="@style/MyTheme"
Run Code Online (Sandbox Code Playgroud)

请记住android:fastScrollThumbDrawable 蜂窝前不存在.


我希望你能帮我解决这个问题.:)

更新:

几个小时前,HoloEverywhere已经添加了快速滚动支持:

https://github.com/ChristopheVersieux/HoloEverywhere/commit/34561e48339bf6a3e0307d2d35fc4c5ac8409310

我会检查一下.:)

saf*_*ari 0

改变这个:

<style name="MyTheme">
    <item name="fastScrollThumbDrawable">@drawable/fastscroll_thumb_holo</item>
</style>
Run Code Online (Sandbox Code Playgroud)

对于这样的事情,你似乎忘记了那里的一个属性:

<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="listviewfastscrollstyle" parent="android:Theme">
    <item name="android:fastScrollTrackDrawable">@drawable/fastscroll_thumb_holo</item>
    <item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb_holo</item>
</style>

</resources>
Run Code Online (Sandbox Code Playgroud)

现在应该可以了:)

此致

苹果浏览器