我们怎样才能改变一个微调的背景颜色? [英] how can we change the background color of a spinner?

查看:103
本文介绍了我们怎样才能改变一个微调的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变微调的背景颜色。但是,当我使用下面的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 :

<一个href="http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html">http://android-er.blogspot.com/2010/12/custom-spinner-with-icon.html

<一个href="http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/">http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/

<一个href="http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog">http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

这篇关于我们怎样才能改变一个微调的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆