I am trying to change the color of the text and the button for the Spinner function programatically. how can i change the text and button color of my spinner without changes in the xml??
Following code:
Spinner label_Col_5_dataSpinner = new Spinner(this);
label_Col_5_dataSpinner.setId(200+Count);
String[] label_Col_5_data= new String[]{"Vivian","Xiaomi","Chris","Bill","Luyi"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,label_Col_5_data );
label_Col_5_dataSpinner.setAdapter(adapter);
label_Col_5_dataSpinner.setPadding(30, 20, 30, 20);
label_Col_5_dataSpinner.setBackgroundColor(Color.TRANSPARENT);
//label_Col_5_dataSpinner.setTextColor(Color.BLACK);
tr.addView(label_Col_5_dataSpinner);