如何更改蜂窝子preference屏幕的背景颜色 [英] How to change background color of child preference screen in honeycomb

查看:116
本文介绍了如何更改蜂窝子preference屏幕的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找对过去几天的解决方案,但未能找到。

I have been searching for the solution for the last several days but could not find one.

我需要更改右窗格的背景颜色(我知道如何更改左父preference的颜色)。我在清单文件中创建一个新的主题。

I need to change the background color of the right pane (I know how to change the color of the left parent preference). I created a new theme in manifest file.

<activity android:name=".PreferenceWithHeaders"
        android:label="@string/app_name"
        android:theme="@style/PreferencesTheme">
</activity>

下面是styles.xml的preferencesTheme部分

Below is the PreferencesTheme portion of styles.xml

<style name="PreferencesTheme" parent="android:Theme.Holo">
    <item name="android:windowBackground">@drawable/background</item>
</style>

我,但无法改变孩子 preferenceScreen 这是右边的默认的灰色背景色。请看看照片。

I am, however, unable to change the default gray background color of the child PreferenceScreenwhich is on the right. Please take a look at the picture.

我尝试不同的事情,但他们没有在背景色的任何影响。任何指针会深深AP preciated!

I tried different things but they don't have any impact on the background color. Any pointers will be deeply appreciated!

推荐答案

我不久前有同样的问题;无法弄明白的时候,甚至还试图在众多的解决方案后,在这里。运行到类似的问题在以后的修复终于迷迷糊糊。

I had this same issue not long ago; couldn't figure it out at the time, even after trying many of the solutions here. Finally stumbled upon a fix after running into a similar issue.

我刚写完一篇博客文章关于它的详细解释,的修复空白空格问题与Android列表视图,但基本上你应该能够通过设置摆脱了空白的 overScrollFooter @null

I just finished writing a blog post about it that explains in more detail, Fixing empty white space issues with Android ListViews, but basically you should be able to get rid of the white space by setting overScrollFooter to @null.

由于overScrollFooter仅在Android平台所提供2.3.3+(API等级10+),你有这样的事情:

As overScrollFooter is only available in Android 2.3.3+ (API Level 10+), you'd have something like this:

RES /价值/ styles.xml

res/values/styles.xml

<style name="MyListView" parent="@android:style/Widget.ListView">
</style>

RES / 值-V10 /styles.xml

res/values-v10/styles.xml

<style name="MyListView" parent="@android:style/Widget.ListView">
    <item name="android:overScrollFooter">@null</item>
</style>

当然,更新您的preferencesTheme使用它:

And of course update your PreferencesTheme to use it:

<style name="PreferencesTheme" parent="android:Theme.Holo">
    <item name="android:windowBackground">@drawable/background</item>
    <item name="android:listViewStyle">@style/MyListView</item>
</style>

这篇关于如何更改蜂窝子preference屏幕的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆