Android首选项屏幕出现在防晒霜下方

时间:2013-07-31 17:40:16

标签: android preferences

在Android中,我有一个首选屏幕(请参阅第一个屏幕截图)。用户点击“选择球”并显示子屏幕(参见第二个屏幕截图)。但是,第一个屏幕仍显示在第二个屏幕下方,例如显示子屏幕时,您可以看到“选择球”。我该如何防止这种情况?

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
    android:title="@string/livewallpaper_settings">

    <PreferenceScreen
        android:key="ball_color_category_key"
        android:persistent="false"
        android:title="@string/ballcolor" >

        <PreferenceCategory android:title="@string/livewallpaper_settings" >
            <CheckBoxPreference
                android:defaultValue="true"
                android:key="redball"
                android:summary="Display red ball."
                android:title="Display red ball" />
            <CheckBoxPreference
                android:defaultValue="true"
                android:key="greenball"
                android:summary="Display green ball."
                android:title="Display green ball" />
            <CheckBoxPreference
                android:defaultValue="true"
                android:key="blueball"
                android:summary="Display blue ball."
                android:title="Display blue ball" />
            <CheckBoxPreference
                android:defaultValue="true"
                android:key="yellowball"
                android:summary="Display yellow ball."
                android:title="Display yellow ball" />
            <CheckBoxPreference
                android:defaultValue="true"
                android:key="purpleball"
                android:summary="Display purple ball."
                android:title="Display purple ball" />
        </PreferenceCategory>
    </PreferenceScreen>

    <PreferenceCategory android:title="@string/livewallpaper_settings" >
        <Preference
            android:key="facebook"
            android:summary="@string/facebook"
            android:title="@string/facebook" />
    </PreferenceCategory>

</PreferenceScreen>

First screen

Second screen

1 个答案:

答案 0 :(得分:0)

我的解决方案是在manifest.xml文件的Activity中设置主题:

<activity android:label="@string/livewallpaper_settings"  
    android:name="com.developername.LiveWallpaperSettings"
    android:exported="true"
    android:icon="@drawable/ic_launcher"
    android:theme="@android:style/Theme.Black">
</activity>`