更改微调器项目高亮显示颜色



我想将微调器项目的突出显示橙色更改为蓝色。我遵循这个图图里亚尔:http://androidopentutorials.com/android-how-to-get-holo-spinner-theme-in-android-2-x/

在res/drawable hdpi、res/drawablemdpi、res/derawable xhdpi和res/drawtable xxhdpi中,我在http://android-holo-colors.com/(和res/drawable中的.xml文件)

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

我做错了什么?

主题.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
    ...

我想明白了。

主题.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文件

相关内容

  • 没有找到相关文章

最新更新