【发布时间】:2012-01-27 21:19:31
【问题描述】:
我正在开发一款 Android 平板电脑应用。我创建了一个自定义操作栏,并设法按照我想要的方式设置它的样式,除了微调器。
我的主题扩展了 Holo Light,这意味着当我按下微调器时,它会变成蓝色。我该如何更改?
【问题讨论】:
标签: android android-widget spinner android-3.0-honeycomb android-4.0-ice-cream-sandwich
我正在开发一款 Android 平板电脑应用。我创建了一个自定义操作栏,并设法按照我想要的方式设置它的样式,除了微调器。
我的主题扩展了 Holo Light,这意味着当我按下微调器时,它会变成蓝色。我该如何更改?
【问题讨论】:
标签: android android-widget spinner android-3.0-honeycomb android-4.0-ice-cream-sandwich
在您的主题中为 android:actionDropDownStyle 指定自定义样式,该主题本身具有用于您的自定义状态列表可绘制对象的 android:background。
这是默认指定的:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:drawable="@drawable/spinner_ab_disabled_holo_dark" />
<item android:state_pressed="true"
android:drawable="@drawable/spinner_ab_pressed_holo_dark" />
<item android:state_pressed="false" android:state_focused="true"
android:drawable="@drawable/spinner_ab_focused_holo_dark" />
<item android:drawable="@drawable/spinner_ab_default_holo_dark" />
</selector>
您需要为这些状态中的每一种(以及 mdpi、hdpi 和 xhdpi)提供自己的图像。
您可以修改平台附带的内容,让您的生活更轻松。在drawable-mdpi、drawable-hdpi 和drawable-xhdpi 文件夹中查看SDK/platforms/platform-14/data/res/。
【讨论】: