问题描述
我想改变微调的背景颜色。但是,当我使用下面的code在XML--机器人改变微调的背景:背景=#000000。我能够改变的背景,但已显示在右侧的微调来看在前看不见的箭头。有没有其他的方法来改变backgroundof微调没有松动的箭头???
I want to change the background color of the spinner. But when I am changing the background of the spinner using the following code in the XML-- android:background="#000000". I am able to change the background but the arrow that is displayed at the right side of the spinner view disapears. Is there any other way to change the backgroundof the spinner without loosing the arrow???
推荐答案
添加这个主题到您微调器:
Add this theme to you spinner:
值/ styles.xml
values/styles.xml
<resources>
<style name="MyTheme">
<item name="android:spinnerStyle">@style/StandardSpinner</item>
</style>
</resources>
<style name="StandardSpinner" parent="@android:style/Widget.Spinner">
<item name="android:background">@drawable/spinner</item>
</style>
另外,也要看看这些:
Also look at these :
http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html
http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/
http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
这篇关于我们怎样才能改变一个微调的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!