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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:43:11+00:00 2026-05-30T05:43:11+00:00

I have a custom spinner that uses two custom views, one for the drop

  • 0

I have a custom spinner that uses two custom views, one for the drop down and one for the currently selected item.

My problem is, the custom view for the currently selected item is always at least as wide as the longest item in the spinner list and it leaves a sizeable gap on the left hand side of my custom view. If I select the longest item from the spinner, the gap disappears. I have tried android:gravity=”left” for my custom view. Also note that this only seems to be an issue with Android 3.0+.

This shows the gap when a short spinner entry is selected

Notice no gap is present between the icon and folder name

Here is the code for my custom spinner view:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/folder_detail" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_width="wrap_content">

<TextView android:text="Folder Name" 
    android:id="@+id/folder_name" android:textColor="#ffffff"
    android:layout_width="wrap_content" android:textSize="16sp"
    android:textStyle="bold"
    android:layout_height="wrap_content" android:layout_marginTop="0dp">
</TextView>

    <TextView android:id="@+id/folder_count" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="13sp"  android:text="(0) " android:textColor="@color/light_blue" android:layout_marginLeft="2dp"/>


<ImageView android:id="@+id/icon" android:src="@android:drawable/arrow_down_float" 
    android:layout_marginRight="1dp" android:scaleType="fitXY"
    android:layout_gravity="bottom" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
 </LinearLayout> 
  • 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-30T05:43:12+00:00Added an answer on May 30, 2026 at 5:43 am

    This is intentional. It prevents the spinner from drastically changing size as the selection changes.

    You’re not meant to include an arrow as part of the item view; this is normally included as part of the background 9-patch of the spinner itself. The gravity setting on the spinner itself controls the alignment of the selected item view within the spinner. The Holo theme aligns it to the left, while the legacy themes horizontally center.

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

Sidebar

Related Questions

I have a spinner getting views from a custom base adapter. The problem is
I have custom classes that I currently instantiate within App.xaml as resources. I want
I have two spinners in an activity, A and B. Each spinner uses an
I have a custom spinner layout with an image and a text view but
I have a few models that need to have custom find conditions placed on
I'm looking into some XSS prevention in my Java application. I currently have custom
I have a custom spinner (customized for formatting). It works fine and shows the
I have a AS spinner class that I downloaded from Jake Hawkes ( click
I have custom drupal module. I receive result from a webservice that I need
I have custom SiteMapProvider and RoleProvider that works together properly: IsAccessibleToUser returns false if

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.