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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:57:10+00:00 2026-06-07T20:57:10+00:00

I have a problem with my RelativeLayout . I placed 6 Views next to

  • 0

I have a problem with my RelativeLayout.

I placed 6 Views next to each other and it works.

The problem i have are the EditTexts. When i set their width to wrap_content they are too small.

When i set them to match_parent they take the whole width (they are overlaying the other Views) instead of adjusting to the edges of the Views next to them.

So my question is how can i make them fit without giving them static widths?

Here is my code:

<RelativeLayout
    android:id="@+id/relativelayout1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <TextView
        android:id="@+id/tv1"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="text 1" />

    <EditText
        android:id="@+id/et1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/tv1"
        android:singleLine="true" />

    <TextView
        android:id="@+id/tv2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/et1"
        android:text="text 2" />

    <EditText
        android:id="@+id/et2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/tv2"
        android:singleLine="true" />

    <TextView
        android:id="@+id/tv3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/et2"
        android:text="text 3" />

    <Spinner
        android:id="@+id/spinner1"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_toRightOf="@+id/tv3" />

</RelativeLayout>
  • 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-07T20:57:13+00:00Added an answer on June 7, 2026 at 8:57 pm

    With a Relative Layout you need either a satisfaying wrapcontent or static dimensions.
    If I understand well, you want the edit text to fill what is left of the screen’s width.
    You would have to use a LinearLayout and the android:layout_weight property – you can find an example here:

    <LinearLayout
            android:id="@+id/ll"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation:"horizontal">
            <TextView
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:text="text 1" />
    
            <EditText
            android:id="@+id/et1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:singleLine="true"/>
    
            <EditText
            android:id="@+id/et2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:singleLine="true" />
    
            <TextView
            android:id="@+id/tv3"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:text="text 3" />
    
            <Spinner
            android:id="@+id/spinner1"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true" />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with two Textviews on the same height in a RelativeLayout
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
My problem is that i have placed an ImageView and 6 TextViews as below
i have a problem with an RelativeLayout. I try to create the following with
I have a problem with a RelativeLayout containing two TextView s and a ImageView
I have a problem i cant resolve with EditText boxes in my views. If
I have some problem with RelativeLayout positioning: Now I have this: http://dl.dropbox.com/u/18411570/now.png And I
I have a RelativeLayout that holds some views. One of the views is MapView
I have a RelativeLayout in which I have two images. The problem is the
I have a problem about RelativeLayout,i dunno know how to add a scrollview,i want

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.