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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:36:34+00:00 2026-05-23T12:36:34+00:00

I have a layout that contains a TableLayout with three rows. Each row has

  • 0

I have a layout that contains a TableLayout with three rows. Each row has a TextView and a Spinner. The Spinners’ column is set to stretch. My problem is that the Spinners are stretching off the edge of the screen when they contain a long string. I would like them to truncate the string instead. Here’s a screenshot of the problem:

http://www.comicfanboy.net/images/screenshot.png

and here’s the xml for the layout:

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/settings_scrollview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center_horizontal">
    <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:paddingLeft="3dp" android:paddingRight="3dp">
        <TextView android:id="@+id/textView1" android:layout_height="wrap_content" android:text="@string/general_information_defaults" android:gravity="center_horizontal" android:layout_width="fill_parent"></TextView>
        <TableLayout android:layout_height="wrap_content" android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:stretchColumns="1">
            <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">
                <TextView android:id="@+id/textView2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="right|center_vertical" android:text="Spinner Label 1"></TextView>
                <Spinner android:layout_height="wrap_content" android:id="@+id/default_organization_spinner" android:layout_width="wrap_content"></Spinner>
            </TableRow>
            <TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content">
                <TextView android:id="@+id/TextView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="right|center_vertical" android:text="Spinner Label 2"></TextView>
                <Spinner android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/default_sport_spinner"></Spinner>
            </TableRow>
            <TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content">
                <TextView android:id="@+id/TextView02" android:gravity="right|center_vertical" android:layout_height="fill_parent" android:layout_width="fill_parent" android:text="Spinner Label 3"></TextView>
                <Spinner android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/default_injury_spinner"></Spinner>
            </TableRow>
        </TableLayout>
        <TextView android:layout_width="fill_parent" android:id="@+id/TextView03" android:gravity="center_horizontal" android:layout_height="wrap_content" android:text="@string/email_defaults" android:paddingTop="20dp"></TextView>
        <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/TableLayout01" android:stretchColumns="1">
            <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow02">
                <TextView android:layout_height="fill_parent" android:id="@+id/TextView04" android:gravity="right|center_vertical" android:layout_width="fill_parent" android:text="@string/to"></TextView>
                <EditText android:inputType="textEmailAddress" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/default_to_field">
                    <requestFocus></requestFocus>
                </EditText>
            </TableRow>
            <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TableRow01">
                <TextView android:layout_height="fill_parent" android:id="@+id/TextView06" android:gravity="right|center_vertical" android:layout_width="fill_parent" android:text="@string/cc"></TextView>
                <EditText android:inputType="textEmailAddress" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/default_cc_field"></EditText>
            </TableRow>
        </TableLayout>
        <TextView android:layout_width="fill_parent" android:id="@+id/TextView05" android:gravity="center_horizontal" android:layout_height="wrap_content" android:text="@string/program_options" android:paddingTop="20dp"></TextView>
        <CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:paddingLeft="40dp" android:id="@+id/auto_sync_checkbox" android:text="@string/auto_sync_at_login"></CheckBox>
    </LinearLayout>
</ScrollView>
  • 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-23T12:36:34+00:00Added an answer on May 23, 2026 at 12:36 pm

    android:layout_width="100dip" Use this tag in the spinner.

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

Sidebar

Related Questions

I have list view with custom row layout (list_row.xml) that contains CheckBox element: <TableLayout
I have a layout that contains three rows or segments in my Android view.
I have a layout that contains several sub-views all which set height like: <View
I have a layout that is working, but it has one very annoying problem..
Hy, I have a layout in the views/layout that has 2 cols and then
I have been able to design my layout so that it has 2 columns
I have a UI layout that's comprised of a single outer layout that contains
I have different table rows, each of it contains some information text which should
I have a linear layout that contains 6 images, which span the linear layout
I have a LinearLayout that contains sublayouts which essentially mimick a 3x2 grid. Each

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.