Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:01:58+00:00 2026-05-22T15:01:58+00:00

I am having a spinner with a simple list in it. I want to

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:01:59+00:00Added an answer on May 22, 2026 at 3:01 pm

    Didn’t try it, but android:typeface in XML or setTypeface() 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:

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="9pt"
    android:singleLine="True"
    android:id="@+id/spinnerTarget"
    android:textColor="#000000"
    android:gravity="center"/>
    

    Then in your code, use something like this:

    Spinner mySpinner = (Spinner) findViewById(R.id.my_spinner);
    mySpinnerArrayAdapter = new MyCustomArrayAdapter(this, R.layout.my_spinner_style);  
    mySpinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    

    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:

    private class MyArrayAdapter extends ArrayAdapter {
    
        public MyArrayAdapter(Context context, int textViewResourceId) {
            super(context, textViewResourceId);
        }
    
        public TextView getView(int position, View convertView, ViewGroup parent) {
            TextView v = (TextView) super.getView(position, convertView, parent);
            v.setTypeface(myFont);
            return v;
        }
    
        public TextView getDropDownView(int position, View convertView, ViewGroup parent) {
            TextView v = (TextView) super.getView(position, convertView, parent);
            v.setTypeface(myFont);
            return v;
        }
    
    }
    

    The font you want to use needs to reside in the assets/fonts directory, and you access it like so:

    Typeface myFont = Typeface.createFromAsset(getAssets(), "fonts/myfont.ttf");
    

    And that’s pretty much it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android spinner that's populated by a list of strings using an
I'm having issues with multithreading in my application. I know there are many posts
I am having an Android view with a Spinner on it. I call a
Having a issue where all mobile devices is zoomed 50% in at start. That
Having the function name 'foo' and its argument 'arg' in strings, is there a
Having been a PHP developer on LAMP servers for quite a while, is there
I'm having a spinner which is populated with a CursorAdapter . Now when creating
I'm having some problems with setSelection on a Spinner. I set the value to
I'm trying to save a spinner's selection to a shared preference, but I'm having
I am trying to make an application that will have a set of screens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.