4
我正在使用Android平板电脑应用程序。我创建了一个自定义操作栏,并按照自己想要的方式设置了样式,除了纺纱工。Android更改微调按下颜色光全息主题
我的主题扩展了Holo Light,这意味着当我按下微调器时它会变成蓝色。我该如何改变这一点?
我正在使用Android平板电脑应用程序。我创建了一个自定义操作栏,并按照自己想要的方式设置了样式,除了纺纱工。Android更改微调按下颜色光全息主题
我的主题扩展了Holo Light,这意味着当我按下微调器时它会变成蓝色。我该如何改变这一点?
在您的主题中指定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,华电国际和xhdpi)提供自己的图像。
您可以修改平台附带的版本,让您的生活更轻松。在drawable-mdpi
,drawable-hdpi
和drawable-xhdpi
文件夹中查找SDK/platforms/platform-14/data/res/
。
我增加了以下我的主题<项目名称= “机器人:actionDropDownStyle”><! - 风格溢出菜单中的项目 - > @风格/ MySpinner 然后创建 <样式名称= “MySpinner”>- @ drawable/spinner_background
这似乎并不奏效。将spin_background drawable作为背景添加到xml布局中的微调器时,它可以工作。所以我可以排除可绘制的问题。 –
bencallis
2012-01-28 23:43:51