更改背景颜色微调的项目 [英] Changing background color for items of Spinner

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

问题描述

我的工作在Android application.I正在使用微调控件并添加项目到它。 有没有办法改变的微调项的背景颜色。
任何一个可以帮助我在设法解决这个问题。
在此先感谢,

I am working on Android application.I am using Spinner control and added items to it. Is there a way to change the background color of items in spinner.
can any one help me in sorting out this issue.
Thanks in Advance,

推荐答案

如果你完全想自定义您的背景微调,您应该使用9patch背景。

If you completely want to customize your background spinner, you should use 9patch background.

下面是一个教程解释如何做到这一点: http://www.gersic.com/blog.php?id=57

Here is a tutorial that explain how to do that : http://www.gersic.com/blog.php?id=57

否则,由user432209给出的解决方案是最简单的。 但是,如果你想要做的,在XML布局:

Otherwise, the solution given by user432209 is the simplest. However, if you want to do that in xml layout :

<Spinner android:id="@+id/spinner"
         ...
         android:background="#YOUR_HEXA_COLOR"/>

这篇关于更改背景颜色微调的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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