【发布时间】:2011-12-29 17:55:19
【问题描述】:
我有一个带有图像和文本视图的自定义微调器布局,但我注意到根据制造商的皮肤,您无法看到文本,因为颜色,即。白底白字,黑底黑字。
我还注意到我的其他非自定义微调器都没有这样做并且似乎会自动更改,所以我的问题是如何更改文本颜色以便可以阅读?
这是一个非自定义微调器
ArrayAdapter<CharSequence> cAdapter;
cAdapter = ArrayAdapter.createFromResource(this, R.array.colors,android.R.layout.simple_spinner_item);
int cSpinnerDD = android.R.layout.simple_spinner_dropdown_item;
cAdapter.setDropDownViewResource(cSpinnerDD);
color.setAdapter(cAdapter);
自定义微调器我只是覆盖视图以将图像与文本一起放入
这是它的布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/icon_txt"
android:paddingLeft="25dp"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
【问题讨论】: