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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:29:32+00:00 2026-05-14T16:29:32+00:00

I have a Spinner with an ArrayAdapter that feeds Values into it. The layout

  • 0

I have a Spinner with an ArrayAdapter that feeds Values into it. The layout for this views looks something like this:

        <TextView
           android:text="Household Income: "
           android:layout_width="wrap_content"
           android:layout_height="fill_parent"
           android:gravity="center_vertical" />

        <Spinner
           android:id="@+id/incomespinner"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:padding="2dip"  />

The Problem is that the text is to long for the view and the result is a very very ugly spinner. As can be seen in the screenshot:

alt text
(source: janusz at janusz.de)

I tried to pass the Id of my own TextView into the Adapter but everytime the spinner should be shown I get an Exception that the Id I supplied is not valid:

04-26 17:38:39.695: ERROR/AndroidRuntime(4276): android.content.res.Resources$NotFoundException: Resource ID #0x7f09003a type #0x12 is not valid

Where do I have to define the TextView? In a separate xml file? With a surrounding viewgroup?

It would help me a lot if I could see an example of the adapter initialization and the textview definition?

  • 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-14T16:29:33+00:00Added an answer on May 14, 2026 at 4:29 pm

    The answer was to remove the padding from the definition of the Spinner.
    Every time I set the padding of the Spinner the Text gets out of shape.

    The spinner drawable is using the padding box from the nine patch to determine where to draw the the content. If I set a padding manually the definition of the padding from the padding box will be overridden.

    If you want to set a padding in addition to a padding box you need to wrap everything inside that paddinbox into an additional Layout container.

    • 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 view in my layout. I would like that spinner
I have populated a spinner with some data, like this: adapter = newSpinAdapter(this,com.Orange.R.layout.spinnerrowlist,spinnerInfo); adapter.setDropDownViewResource(com.Orange.R.layout.multiline_spinner_dropdown_item);
I have one spinner, and I am populating that. I have list of values
I have an android spinner that's populated by a list of strings using an
I have to develop an android view such that i have 2 spinner controls
I have a Spinner and a SimpleCursorAdapter . For odd/even rows on this spinner
Hi I have a spinner for which I would like to change its entry.
Hi I have a spinner (spinner5) and whenever the user selects an item that
I would like to have a Spinner updated upon an onTap event in my
I have an application, which has a Spinner that I want populated with some

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.