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

  • Home
  • SEARCH
  • 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 8505759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:24:41+00:00 2026-06-11T02:24:41+00:00

I have set a dynamic value in a spinner . I am using following

  • 0

I have set a dynamic value in a spinner . I am using following code for the same.

spinner_generalbooks.setAdapter(new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, new String[]{"Author","ISBN","Keyword","Title"}));

It is working fine, but I have a problem with the view of the spinner . If we select simple_spinner_item, it is ok in normal state, but when we want to change it, the rows are very narrow and not CheckedTextView whereas in normal spinner options comes with CheckedTextView. If we select simple_spinner_dropdown_item, the options come with CheckedTextView, but in normal state, it looks different as in the pic

(First one is default spinner and second one is using simple_spinner_dropdown_item).

First one is default spinner and second one is using <code>simple_spinner_dropdown_item</code>

I want to show the spinner just like as default spinner. How to make it?

  • 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-11T02:24:42+00:00Added an answer on June 11, 2026 at 2:24 am

    Android will take the layout specified in the adapter and use it for the control and the items unless you specify the view-resource separately. The way through this is to set the layout to simple_item in the ArrayAdapter constructor and then set the layout dropdown_item separately in a call to setDropDownViewResource().

    ArrayAdapter newAdapter = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_spinner_item, new String[]{"Author","ISBN","Keyword","Title"});
    
    newAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    
    spinner_generalbooks.setAdapter(newAdapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of 'dynamic data' that I need to bind to the
I have a dynamic set of conditions that are used in a where clause.
I have a dynamic query which I call and I put the Result set
I have created a dynamic web project in Eclipse, but when I set up
I have set up upload_max_filesize and post_max_size to 32Mb in php.ini. I am using
I have a collection of StackPanel which each one includes a dynamic set of
I have a set of JSP tags that use dynamic-attributes to allow for arbitrary
Possible Duplicate: Dynamic array keys I have an array $Values which is set up
I have set the RangeDateValidator in the code behind as shown below, and even
I have a dynamic Class that is a Value Object that is used to

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.