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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:54:45+00:00 2026-06-04T21:54:45+00:00

I have a simple layout, below is a relevant fragment. It looks exactly as

  • 0

I have a simple layout, below is a relevant fragment. It looks exactly as I want it to – as long as the spinner is empty. Once I add items to it (in runtime) – it jumps like half its height down.
Why?

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TableLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="top"
                android:layout_marginTop="10dp" >

                <TableRow
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" >

                    <TextView
                        android:id="@+id/lbl"
                        style="@style/Label.Plain"
                        android:layout_height="@dimen/button_height"
                        android:layout_marginRight="5dp"
                        android:layout_weight="0"
                        android:gravity="left|center_vertical" />

                    <Spinner
                        android:id="@+id/spinner"
                        style="@style/Spinner"
                        android:background="#ff0000"
                        android:layout_width="fill_parent"
                        android:layout_weight="1" />

                </TableRow>
            </TableLayout>
        </LinearLayout>
    </LinearLayout>
</ScrollView>

And this is “Spinner” style:

<style name="Spinner" parent="@android:style/Widget.Holo.Spinner">
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">@dimen/button_height</item>
        <item name="android:textSize">@dimen/spinner_text</item>
        <item name="android:textColor">@color/button</item>
        <item name="android:gravity">center_vertical</item>
        <item name="android:padding">2dp</item>
        <item name="android:maxLines">1</item>
   </style>
  • 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-04T21:54:46+00:00Added an answer on June 4, 2026 at 9:54 pm

    Don’t understand why, but the problem disappeared as soon as I set spinner’s padding to 0dp instead of 2dp specified by the style.

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

Sidebar

Related Questions

Simple problem: With the XML layout shown below, I have some views wrapped in
I have created a simple layout with Html and CSS which is like below
I have a simple layout like below (which only shows a text TEST): <?xml
I have simple WPF layout task and looking to avoid code-behind if possible. I
I have created a simple layout using the HTML div tag. I would like
I have a simple page layout with two divs--one on top, and one on
I have a fairly simple layout with an image, and some textviews wrapped in
I have to make a simple layout in android but have problem with the
I'm trying to build the simple layout that I have got in the image
Simple - I have a layout that is 800 by 600. When I press

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.