When I disable my Spinner it looks almost exactly like it did prior to being disabled, i.e.
Before
The .getSelectedView()
did not work for me. So I tricked the Spinner
to show being disabled.
You will need to define your own colors for the disabled look.
For Example:
R.color.blue_text //means enabled
R.color.gray_text //means disabled
So to disable my spinner:
((TextView)mySpinner.getChildAt(0)).setTextColor(getResources().getColor(R.color.gray_text));
mySpinner.setEnabled(false);
mySpinner.setFocusable(false);
To enable my spinner:
((TextView)mySpinner.getChildAt(0)).setTextColor(getResources().getColor(R.color.blue_text));
mySpinner.setEnabled(true);
mySpinner.setFocusable(true);
You don't need to change styles or modify any XML. Just do this in your code, even within event methods, you should be fine.