How to set your own font for the counter?

Is there any way to set my own font or color for the selected item in Spinner? For example, I open the counter and select the priority "High". I have my layout containing a spinner, I would like to see the word "High" in red or a custom font.

I cannot get a text view to make the necessary changes. I always get a NullPointerException if I create spinner.getSelectedView () for a textview and try to set the color. any ideas? thanks in advance!

+3
source share
2 answers

You are the one who says Android "font or color for the selected item in Spinner." This comes from the layout resource that you pass in SpinnerAdapterto which you pass Spinner. If you don’t like the layout you are currently using, change the layout. If you are using the layout provided by Android, copy it from your SDK ( $ANDROID_HOME/platforms/$VERSION/data/res/) to your project, modify it, and then refer to the local layout, not the system one.

+1
source

, . , . , , . ? , Typeface textview , .

0

Source: https://habr.com/ru/post/1741716/


All Articles