如何更改PreferenceActivity xml样式/主题

时间:2013-11-21 09:52:26

标签: android android-layout android-xml

  

更改背景颜色,分隔线颜色等.... Settings.xml

In manifest,
        <activity
        android:name="package.Settings"
        android:screenOrientation="portrait" 
        android:theme="@style/settingslist_row" >
    </activity>

 @Style
 <style name="settingslist_row">
    <item name="android:divider">#FF0000</item>
    <item name="android:textColorSecondary">#87CEEB</item>
    <item name="android:dividerHeight">2dp</item>       
</style>

我的问题是分频器颜色不起作用

 <item name="android:divider">#FF0000</item> 

1 个答案:

答案 0 :(得分:1)

我的应用布局

<PreferenceCategory android:title="Wallpaper Settings" >

    <PreferenceScreen
        android:key="aliveWallpaperList"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Select your live wallpaper"
        android:title="Video Menu" >
    </PreferenceScreen>

    <Preference
        android:key="download_all_videos_button"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Download all videos in one step"
        android:title="Download all" />

    <!--<CheckBoxPreference
        android:defaultValue="false"
        android:key="RapidCheck"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Turns off server-check.Great once all videos are downloaded"
        android:title="Rapid Video Menu" />

    --><PreferenceScreen
        android:layout="@layout/custom_preferece_layout"
        android:summary="If you have a promo code, enter it here"
        android:title="Promo Code" >

        <intent
            android:targetClass="com.alivewallpaper.free.promocode.PromoCodeVerificationActivity"
            android:targetPackage="com.alivewallpaper.free" />
    </PreferenceScreen>

    <PreferenceScreen
        android:key="addPreference"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Remove ads and get bonus videos and features"
        android:title="Remove Advertising" >
    </PreferenceScreen>
    <PreferenceScreen
        android:key="License"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Terms of use"
        android:title="License " >
    </PreferenceScreen><!--
    <PreferenceScreen
        android:key="freezeWallpaper"
        android:layout="@layout/custom_preferece_layout"
        android:summary="Freeze the video wallpaper"
        android:title="Freeze" >
    </PreferenceScreen>
--></PreferenceCategory>