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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:38:12+00:00 2026-06-04T02:38:12+00:00

Say I got one EditText and one Button next to each other horizontally. Left

  • 0

Say I got one EditText and one Button next to each other horizontally. Left we got the EditText and right the Button.

The thing is, I want the button to wrap it’s content while the EditText stretches itself from the left of the screen all the way to the button. So the button is as small as possible (depending on button text) and the EditText is as wide as possible (depending on button size)

I don’t know if I’ve missed a simple trick… but how do I accomplish that?

  • 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-04T02:38:13+00:00Added an answer on June 4, 2026 at 2:38 am

    You have to use a RelativeLayout, make the Button align right and set the EditText to be left of the button. After that, fill_parent for the EditText and wrap_content for the Button will do the magic.

    A look at the code below clarifies everything.

    <RelativeLayout
        android:id="@+id/RL1"
        ...
        android:orientation="horizontal" >
    
            <EditText
                android:layout_width="fill_parent"
                ...
                android:layout_toLeftOf="@+id/buttonRight" >
            </EditText>
    
            <Button
                android:id="@+id/buttonRight"
                android:layout_width="wrap_content"
                ...
                android:singleLine="true" 
                android:layout_alignParentRight="true">
            </Button>
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I've got a couple of models, one related to the other via foreign
Say I've got a list. I want to let the user know that one
I'm trying to learn java better and I got one question. Say I got
Let's say I've got an array with strings. NSArray *names = [NSArray arrayWithObjects: @One,
Lets say I've got two interchangeable pieces of code and I want to figure
Let´s say I´ve got the following xml string: <Item Name=\$Resources:myresource,somestring;\</Item> Now I want to
I've got 2 tables, one with dates (let's call it Table1) - let's say
Let's say I've got a vector like this one: A = [101:105] Which is
Let's say I've got two strings.xml files - one for English and one for
Let's say I've got two tables: one with customer data, one with location data.

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.