Saturday, 4 April 2015

How can I set the Text colour for this spinner that I have?




<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner_statements"
android:background="@drawable/file"
android:spinnerMode="dropdown"
android:visibility="gone"
android:layout_marginTop="15dp"
android:touchscreenBlocksFocus="false" />


I want to know if there is anyway I could specify somewhere that I want the text colour of the items inside this spinner should be black.


java code ;



final Spinner spinner= (Spinner)findViewById(R.id.spinner);
String[] items = new String[]{"one", "two"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, items);
spinner.setAdapter(adapter);

No comments:

Post a Comment