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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:56:51+00:00 2026-05-22T23:56:51+00:00

I want to try to get an EditText and Button next to each other.

  • 0

I want to try to get an EditText and Button next to each other. I currently have where the button is on the right and the edit text is left aligned but the button then shows that it is on top of the EditText. I want the Button to start where the EditText ends.

This is what I have right now:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#004D79">
        <RelativeLayout android:id="@+id/relativeLayout1" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content">
        <EditText 
            android:layout_alignParentLeft="true" 
            android:text="EditText"
            android:layout_marginTop="10dp" 
            android:id="@+id/editText" 
            android:layout_height="wrap_content" 
            android:layout_width="fill_parent">
        </EditText>
        <Button android:text="Skip"
         android:id="@+id/skipButton" 
         android:textSize="18sp"
         android:layout_marginTop="10dp" 
         android:layout_alignParentRight="true" 
         android:layout_height="wrap_content" 
         android:layout_width="80dp">
         </Button>
    </RelativeLayout> 
</LinearLayout>

I tried to set it up with making the EditText width with an exact dp amount but then when the screen flips horizontal there is a big gap between the EditText and Button.

  • 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-22T23:56:52+00:00Added an answer on May 22, 2026 at 11:56 pm

    If you want to continue to use a relative layout and have the edit text to go up until the button you can add this to the edittext xml

    android:layout_toLeftOf="@+id/skipButton"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi want to get the place name from the edit text and mark on
I try to write get method for my class bassed on ListView, I want
Hi I didn't get an answer before so second try... I want to control
I want to try out Joda Time with Play Framework 2.0. So I have
Having dealt with yet another stupid eclipse problem, I want to try to get
Basically I want to create a rock solid server. while (keepRunning.get()) { try {
I want to try and get the ip address of a client after calling
I want to try and get an understanding of how JMS works. I am
I want to try and get a cross browser gradient effect working with rgb
I want to have 3 edittext with top and bottom having topleft and topright

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.