I am having a spinner with a simple list in it. I want to know whether I could replace the style of the font in my spinner. Or is there anyway that I could make use to change the font style,size and color.
Any clearance given is much appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Didn’t try it, butandroid:typefacein XML orsetTypeface()in code should work.EDIT: Please follow the guidance here.
First, create a new XML file in your res/layout directory called “
my_spinner_style.xml“, and put in something like the following content:Then in your code, use something like this:
Normally you would create a new ArrayAdapter for the second line, but in this case you need to create a custom ArrayAdapter and override the methods that get the TextView from our custom spinner style.
So, you need to put in the code for your custom ArrayAdapter, like so:
The font you want to use needs to reside in the assets/fonts directory, and you access it like so:
And that’s pretty much it.