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 9018597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:34:03+00:00 2026-06-16T04:34:03+00:00

In my app I am displaying a spinner that contains different font styles e.g.

  • 0

In my app I am displaying a spinner that contains different font styles e.g. if the font name is US DNealian than it should get displayed with the same typeface as well. I know how to set typeface of particular view by view.setTypeface(tf) but I am using an array arr_fonts to fill ArrayList and that ArrayList will fill the adapter for spinner. Below is the code snippet I am using.

-> String array for filling ArrayList

private String arr_fonts[] = {"US: D'Nealian", "US: D'Nealian Cursive", "US: Zaner-Bloser", "US: Zaner-Bloser Cursive",
            "Aus: NSW/ACT", "Aus: NSW/ACT Cursive", "Aus: Qld Beginners", "Aus: Qld Cursive", "Aus: SA Beginners", "Aus: SA Cursive",
            "Aus: Tas Beginners", "Aus: Tas Cursive", "Aus: Vic/NT/WA", "Aus: Vic/NT/WA Cursive", "WA Sassoon", "WA Sassoon Infant",
            "NZ Beginners","UK Beginners", "UK Cursive", "Century Gothic (HWT)"};

->Arraylist for filling adapter

ARRLIST_FONTS = new ArrayList<String>(Arrays.asList(arr_fonts));

private void set_font_name_Adapter() {

    sp_fonts = (Spinner)findViewById(R.id.spFont);

     font_name_Adapter= new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,ARRLIST_FONTS)
              {
            public View getView(int position, View convertView,ViewGroup parent) {
                    View v = super.getView(position, convertView, parent);
                    ((TextView) v).setTextSize(12);
                    ((TextView) v).setTextColor(Color.WHITE);
                    return v;
          }

};

        font_name_Adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        sp_fonts.setAdapter(font_name_Adapter);

        sp_fonts.setOnItemSelectedListener(new OnItemSelectedListener() {

            @Override
            public void onItemSelected(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {

                font = ARRLIST_FONTS.get(arg2);

                }


                System.out.println("Selected item is ................."+font);

            }

            @Override
            public void onNothingSelected(AdapterView<?> arg0) {


            }
        });

}

I have .ttf for all the font names. But I dont know how to change typeface of each item in spinner individually.

Can anyone suggest any thing or any link or good tutorial for the same.

Thanks.

enter image description here

  • 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-06-16T04:34:04+00:00Added an answer on June 16, 2026 at 4:34 am

    try as to set custom Typeface for all TextView’s in spinner :

    Typeface typeface;
    font_name_Adapter= new ArrayAdapter<String>
                    (this,android.R.layout.simple_spinner_item,ARRLIST_FONTS)
           {
                public View getView(int position, View convertView,ViewGroup parent) {
                   View v = super.getView(position, convertView, parent);
                   ((TextView) v).setTextSize(12);
                   ((TextView) v).setTextColor(Color.WHITE);
    
                    if(position<=ARRLIST_FONTS.size()){
                     typeface = 
                      Typeface.createFromAsset(Your_Current_Activity.this.getAssets(),
                                   "fonts/yourfontname.ttf"); 
                         ((TextView) v).setTypeface(typeface);
                       }
    
                        return v;
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF web-service and a Silverlight app displaying data from that service.
I've developed a user experience in my iOS app for displaying a different view
in my app I am displaying number strings and noticed that 7.000444 displays as
I'm building a relatively basic news-reader app that involves displaying news in a custom
I have an Android app that begins by displaying a dialog. When I set
I've got an app that has all content regardless of language displaying content in
I have a facebook app that is displaying random quotes - it is written
I've noticed that emojis in my app have stopped displaying properly on a UIWebView
I currently have an app displaying the build number in its title window. That's
In my app i am displaying images 1 after other for 1 second.In that

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.