问题描述
我开发一个应用程序中,我需要改变微调的背景布局相匹配的背景颜色。我研究后发现,我需要建立一个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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!