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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:00:44+00:00 2026-05-29T07:00:44+00:00

Please provide a solution to arrange two EditView controls same horizontal position. How to

  • 0

Please provide a solution to arrange two EditView controls same horizontal position. How to left align EditView of Port with EditView of IP Address. Also providing screen shot of current view

enter image description here

please find current layout code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="210dip"
android:layout_marginTop="10dip"
android:background="#DDDDDD"
>
<TextView
    android:id="@+id/head"
    android:text="Connection Settings"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:textColor="#0000ff"
    android:textSize="10pt" 
/>
<TextView
    android:id="@+id/tv_ip"
    android:layout_width="125dip"
    android:layout_height="wrap_content"
    android:textSize="10pt"
    android:textColor="#444444"
    android:layout_alignParentLeft="true"
    android:layout_marginRight="9dip"
    android:layout_marginTop="20dip"
    android:layout_marginLeft="10dip"
    android:layout_below="@id/head"
    android:text="IP Address"/>
<EditText
    android:id="@+id/et_ip"
    android:layout_width="150dip"
    android:layout_height="wrap_content"
    android:background="@android:drawable/editbox_background"
    android:layout_toRightOf="@id/tv_ip"
    android:layout_alignTop="@id/tv_ip"/>
 <TextView
    android:id="@+id/tv_port"
    android:layout_width="125dip"
    android:layout_height="wrap_content"
    android:textSize="10pt"
    android:textColor="#444444"
    android:layout_alignParentLeft="true"
    android:layout_below="@id/tv_ip"
    android:layout_marginRight="9dip"
    android:layout_marginTop="15dip"
    android:layout_marginLeft="10dip"
    android:text="Port"/>
<EditText
    android:id="@+id/et_port"
    android:layout_width="150dip"
    android:layout_height="wrap_content"
    android:background="@android:drawable/editbox_background"
    android:layout_toRightOf="@id/tv_port"
    android:layout_alignTop="@id/tv_port"
    android:layout_below="@id/et_ip"
    android:layout_marginLeft="17dip"
    />
<Button
    android:id="@+id/btn_Save"
    android:layout_width="100dip"
    android:layout_height="wrap_content"
    android:layout_below="@id/et_port"
    android:layout_alignParentLeft="true"
    android:layout_marginTop="15dip"
    android:layout_marginLeft="110dip"
    android:text="Save" />
</RelativeLayout>

thanks

  • 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-29T07:00:44+00:00Added an answer on May 29, 2026 at 7:00 am

    You just have to add android:layout_alignLeft="@+id/et_ip" in the code of your EditText et_port.
    Here is the corrected code:

    <?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="210dip"
        android:layout_marginTop="10dip"
        android:background="#DDDDDD" >
    
        <TextView
            android:id="@+id/head"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:text="Connection Settings"
            android:textColor="#0000ff"
            android:textSize="10pt" />
    
        <TextView
            android:id="@+id/tv_ip"
            android:layout_width="125dip"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/head"
            android:layout_marginLeft="10dip"
            android:layout_marginRight="9dip"
            android:layout_marginTop="20dip"
            android:text="IP Address"
            android:textColor="#444444"
            android:textSize="10pt" />
    
        <EditText
            android:id="@+id/et_ip"
            android:layout_width="150dip"
            android:layout_height="wrap_content"
            android:layout_alignTop="@id/tv_ip"
            android:layout_toRightOf="@id/tv_ip"
            android:background="@android:drawable/editbox_background" />
    
        <TextView
            android:id="@+id/tv_port"
            android:layout_width="125dip"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/tv_ip"
            android:layout_marginLeft="10dip"
            android:layout_marginRight="9dip"
            android:layout_marginTop="15dip"
            android:text="Port"
            android:textColor="#444444"
            android:textSize="10pt" />
    
        <EditText
            android:id="@+id/et_port"
            android:layout_width="150dip"
            android:layout_height="wrap_content"
            android:layout_alignTop="@id/tv_port"
            android:layout_below="@id/et_ip"
            android:layout_toRightOf="@id/tv_port"
            android:layout_alignLeft="@+id/et_ip"
            android:background="@android:drawable/editbox_background" />
    
        <Button
            android:id="@+id/btn_Save"
            android:layout_width="100dip"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/et_port"
            android:layout_marginLeft="110dip"
            android:layout_marginTop="15dip"
            android:text="Save" />
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If this is possible, please provide a sample query or two so I can
Hey folks, this question can't be too complicated. Please provide a solution to at
PLEASE CHECK ANSWERS by VolkerK too, he provided another solution, but I can't mark
Please provide tips for effectively using git with svn. What are your best practices?
Please provide a good, thorough tutorial about Java class loading , focusing on how
Please provide the diff b/w ref and out parameters in C#
please provide me the possibility of my issue. Can we customize the push notification
Can someone please provide an example of creating a Java ArrayList and HashMap on
Can anyone please provide a link to download the .NET 3.5 SDK? I checked
Can someone please provide a simple example of how to consume a REST service

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.