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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:26:44+00:00 2026-06-17T16:26:44+00:00

In my layout there are many EditTexts, i want to make same width for

  • 0

In my layout there are many EditTexts, i want to make same width for all. I tried with below code and the EditTexts showing different width. how can i solve this problem. My layout as follows

thanks in advance

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:textColor="@color/white"
            android:textSize="20sp"
            android:textStyle="bold"
            android:text="Basic Settings"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left|center_vertical"
                android:textColor="@color/white"
                android:layout_weight="1"
                android:text="Home ID"/>

            <EditText
                android:id="@+id/setup_homeid"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:maxLength="5"
                android:inputType="number"
                android:singleLine="true"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left|center_vertical"
                android:layout_weight="1"
                android:textColor="@color/white"                    
                android:text="Home Name"/>

            <EditText
                android:id="@+id/setup_homename"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:maxLength="12"
                android:inputType="textCapCharacters"
                android:singleLine="true"/>                 

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left|center_vertical"
                android:layout_weight="1"
                android:textColor="@color/white"                    
                android:text="Home Password"/>

            <EditText
                android:id="@+id/setup_homepw"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:maxLength="10"
                android:singleLine="true"
                android:inputType="textPassword|number"/>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="20dp"
            android:paddingRight="20dp"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left|center_vertical"
                android:layout_weight="1"
                android:textColor="@color/white"                    
                android:text="Home Re-password"/>

            <EditText
                android:id="@+id/setup_homerepw"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:maxLength="10"
                android:inputType="textPassword|number"
                android:singleLine="true"/>

        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:textColor="@color/white"
            android:textSize="20sp"
            android:textStyle="bold"
            android:text="IP Settings"/>


    </LinearLayout>
</ScrollView>

screen shot of application

enter image description here

  • 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-17T16:26:46+00:00Added an answer on June 17, 2026 at 4:26 pm

    To take effect android:layout_weight="1" attributes for width you have to set android:layout_width="0dip" for both ChildViews (TextView and EditText)

    Something like:

      <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="20dp"
                android:paddingRight="20dp"
                android:orientation="horizontal">
    
                <TextView
                    android:layout_width="0dip" // this line need to be change
                    android:layout_height="wrap_content"
                    android:layout_gravity="left|center_vertical"
                    android:textColor="@color/white"
                    android:layout_weight="1"
                    android:text="Home ID"/>
    
                <EditText
                    android:id="@+id/setup_homeid"
                    android:layout_width="0dip" // this line need to be change
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:layout_weight="1"
                    android:maxLength="5"
                    android:inputType="number"
                    android:singleLine="true"/>
     </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know how to make a fixed+fluid column layout (and there are many examples
Is there an equivalent to Java's null layout in Android? Basically I want to
Why are there these stupid layout managers which position my stuff. I can understand
I have a form in which there are many textboxes (in tabControl layout). I
There are many tools and SDKs which layout a graph. ogdf, GraphViz, mxGraph, yEd...
In Yii there are many different ways to get CSS into your pages. The
I have many <div> tags separate from each other. They all have this layout:
I want to have facebook like menu in my application. There are many threads
I am creating sort of an app where there are many buttons with different
I know that there are many iternal layouts which I can use for adapters

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.