首页 文章

更改微调器项目突出显示颜色

提问于
浏览
0

我想将微调器项目高亮橙色更改为蓝色 . 我遵循这个tuturial:http://androidopentutorials.com/android-how-to-get-holo-spinner-theme-in-android-2-x/

在res / drawable-hdpi,res / drawable-mdpi,res / drawable-xhdpi和res / drawable-xxhdpi我有http://android-holo-colors.com/中创建的所有.png文件(以及res / drawable中的.xml文件)

In能够更改微调器背景颜色(当用户点击微调器时)和单选按钮颜色 . 但橙色突出显示颜色(当用户点击对话框上的微调项目时)仍为橙色 .

我做错了什么?

的themes.xml

<resources>
<style name="AppBaseTheme" parent="android:Theme.Light">

</style>

<style name="AppBaseTheme.NoTitleBar" parent="@android:style/Theme.Light.NoTitleBar">

    <item name="android:windowBackground">@android:color/white</item>
    <item name="android:colorBackground">@android:color/white</item>

    <!-- Spinner themes -->
    <item name="android:spinnerStyle">@style/SpinnerTheme</item>
    <item name="android:dropDownSpinnerStyle">@style/SpinnerTheme.DropDown</item>
    <item name="android:spinnerDropDownItemStyle">@style/DropDownItemSpinnerTheme</item>
    <item name="android:listViewStyle">@style/ListViewSpinnerTheme</item>
    <item name="android:listViewWhiteStyle">@style/ListViewSpinnerTheme.White</item>
    <item name="android:spinnerItemStyle">@style/SpinnerItemTheme</item>
</style>
</resources>

styles.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="SpinnerTheme" parent="android:Widget.Spinner">
    <item name="android:background">@drawable/spinner_background_holo_light</item>
    <item name="android:dropDownSelector">@drawable/list_selector_holo_light</item>
</style>

<style name="SpinnerTheme.DropDown">
    <item name="android:spinnerMode">dialog</item>
</style>

<!-- Changes the spinner drop down item radio button style -->
<style name="DropDownItemSpinnerTheme" parent="android:Widget.DropDownItem.Spinner">
    <item name="android:checkMark">@drawable/btn_radio_holo_light</item>
</style>

<style name="ListViewSpinnerTheme" parent="android:Widget.ListView">
    <item name="android:listSelector">@drawable/list_selector_holo_light</item>
</style>

<style name="ListViewSpinnerTheme.White" parent="android:Widget.ListView.White">
    <item name="android:listSelector">@drawable/list_selector_holo_light</item>
</style>

<style name="SpinnerItemTheme" 
        parent="android:TextAppearance.Widget.TextView.SpinnerItem">
    <item name="android:textColor">#000000</item>
</style>

</resources>

colors.xml

<resources>

<color name="transparent">#00000000</color>

</resources>

AndroidManifest.xml中

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nsn.mywfm.mobile"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="18" />

...

<application
    android:allowBackup="true"
    android:icon="@drawable/logo_icon"
    android:label="@string/app_name"
    android:supportsRtl="false"
    android:theme="@style/AppBaseTheme.NoTitleBar" >
    <activity
    ...

1 回答

  • 0

    我想到了 .

    的themes.xml

    <resources>
    <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
        <item name="android:windowBackground">@android:color/white</item>
        <item name="android:colorBackground">@android:color/white</item>
    </style>
    </resources>
    

    styles.xml为空,无需在res / drawable中生成图像和.xml文件

相关问题