如何更改微调背景设计和颜色为Android? [英] How to change the spinner background design and color for android?

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

问题描述

我开发一个应用程序中,我需要改变微调的背景布局相匹配的背景颜色。我研究后发现,我需要建立一个9片图像。我已经做了创建9片图像,并在应用程序中使用,但它看起来比正常的微调,也是我看不出在微调的下拉按钮,以及。我真的很担心。

I am developing an app in which i need to change the spinner background layout to match the background color. I researched and found that i need to create a 9 patch image. I have done creating the 9 patch image and used in the app but it looks bigger than the normal spinner and also i couldn't see the drop down button in the spinner as well. I am really worried.

我太高兴了,如果你们提供给我一个明确的教程,从开始创造微调的9片图像,并在应用程序中使用它。

I am so happy if you guys provide me a clear tutorial from start creating the 9 patch image for Spinner and using it in the app.

code的微调

         <Spinner
                android:id="@+id/spnIncredientone"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/txtMixtureTitle" 
                android:layout_marginLeft="5dip"
                android:layout_marginRight="5dip"
                android:background="@drawable/spinner_background"
                android:prompt="@string/selectmixture" />

感谢您的帮助球员。

Thanks for your help guys.

推荐答案

您可以设置微调的背景色在这样的XML:

You can set the spinners background color in xml like this:

android:background="YOUR_HEX_COLOR_CODE"

如果你使用下拉菜单,你微调器,你可以这样设置它的背景色:

and if you use the drop down menu with you spinner you can set its background color like this:

android:popupBackground="YOUR_HEX_COLOR_CODE"

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

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