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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:00:46+00:00 2026-05-12T12:00:46+00:00

I have an EditText and a Button set next to each other on the

  • 0

I have an EditText and a Button set next to each other on the same horizontal line. It looks great, except when the user enters a lot of text, the EditText is resized, and the Button is squished.

I have both EditText and Button set to layout_width="wrap_content". "fill_parent" messes up the layout, and I don’t want to use absolute sizes if I don’t have to – the way it is now looks great in both landscape and portrait, I just don’t want the EditText to resize.

My layout:

<TableLayout
    android:id="@+id/homelayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <TableRow>
        <TextView
            android:id="@+id/labelartist"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Find artists:" />
    </TableRow>
    <TableRow>
        <EditText
            android:id="@+id/entryartist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="6"
            android:background="@android:drawable/editbox_background"
            android:editable="true"
            android:padding="5px"
            android:singleLine="true" />
        <Button
            android:id="@+id/okartist"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginLeft="10dip"
            android:layout_weight="1"
            android:text="Search" />
    </TableRow>

</TableLayout>
  • 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-12T12:00:46+00:00Added an answer on May 12, 2026 at 12:00 pm

    For EditText use

    android:layout_width="0dp" - not required but preferred.
    android:layout_weight="1"
    

    And for Button dont specify android:layout_weight

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

Sidebar

Related Questions

I want to try to get an EditText and Button next to each other.
I have an EditText with a Button next to it. The button is hidden
I have a bunch of EditTexts in my Android application, each with InputMethod set
friends, i have a EditText on simple activity with a button. when every i
I have two EditText and one Button in my Layout. If the two EditText
I need to have a Edittext beside a Search button . The EditText should
I have an Activity with an EditText , a button and a ListView .
I want to put a button next to a EditText and I want their
I am writing a simple android app which have a edittext and a button.
I have a small activity with an EditText and an imageview and a button.

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.