![]() ![]() ResourceCursorAdapter resourceCursorAdapter = new ResourceCursorAdapter(this, R.layout. If you are using an ArrayList for your Spinner Adapter then. ![]() Now to get the position based on a value you have to loop thru the spinner and get the position. The spinner provides a way to set the selected valued based on the position using the setSelection (int position) method. Create a `ResourceCursorAdapter` for the spinner with `this` context. Android Spinner set Selected Item by Value. Some of you that using MaterialBetterSpinner and Binding your Layouts,Īll the above won't help, try this, hope it helps you: public class MyAdapter extends ArrayAdapter ) Using these i am not able to change the text color of selecetd item. I am able to change the background color of the selected item, the color of the dropdown item etc, but not the text color of selected item. How can I change the font color of the selected item in a spinner? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |