无法获取IcsSpinner所需的背景 [英] Unable to get desired background for IcsSpinner
问题描述
这是微调code:
<com.actionbarsherlock.internal.widget.IcsSpinner
android:id="@+id/mSpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/bg_grey" />
bg_grey 是第一个图像中的浅灰色背景。
bg_grey is the light grey color background in the 1st image.
TextView的code dropdown_text.xml
:
TextView code dropdown_text.xml
:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mDropDown"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:background="@android:color/transparent"
android:padding="2dp"
android:textColor="@color/text_dark_grey">
</TextView>
在活动:
ArrayAdapter<String> ,Adapter = new ArrayAdapter<String>(mActivity.this, R.layout.dropdown_text, mArray);
微调的无效状态:
InActive state of the Spinner:
这是我想要的。但是,
微调的Active状态:
Active state of the Spinner:
为什么下拉颜色暗灰色的背景。我想这是浅灰色作为第一形象。
Why is the background of the DropDown color dark grey. I want it to be light grey as in the 1st image.
感谢您
推荐答案
更改您的TextView的背景:
Change the background of your textView to:
&LT;机器人:背景=@色/ bg_grey&GT;
这并不能解释为什么它的暗灰色,但会解决它。
That doesn't explain why it's dark gray, but will fix it.
我有一个ListView,对其中的项目的背景颜色,随机改变一些类似的问题。当我改变了他们留下,因为我想要的ListView项的背景色。仍然是一个谜给我。
I had some similar issue with a ListView, on which the background color of the items were changing randomly. When I changed the background color of the ListView item they stayed as I wanted. Still a mistery to me.
这篇关于无法获取IcsSpinner所需的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!