我看到关于如何更改微调的文本颜色许多话题,但我不能了解如何使用
I saw many topics about how to change spinner's text color,but i couldnt understand how to use
spinner_item.xml
spinner_item.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:singleLine="true"
android:textColor="@color/iphone_text" />
我该怎么真正做到在java中code :? 任何响应将是precieted 请更详细清楚回答,您可以
What shall i really do in java code:? Any responses will be aprecieted Please answer clearly with as more details as you can
在这里,你必须设置你的spinner_item.xml在阵列适配器。加入这块code在你的.java文件
Here You have to set your spinner_item.xml in your array adapter. Add this piece of code in your .java file
Spinner yourSpinner;
ArrayAdapter<String> yourAdapter;
yourSpinner= (Spinner) findViewById(R.id.yourSpinnerID);
yourSpinner.setAdapter(yourAdapter);
yourAdapter= new ArrayAdapter<String>(this, R.layout.spinner_item, value);
//here value is your items in spinner..