XML : Need help on xml layout

I'm new to android and now getting started to build android interface layouts with XML.

xml

  <?xml version="1.0" encoding="utf-8"?>  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"      android:orientation="vertical" android:layout_width="match_parent"      android:layout_height="match_parent"      android:weightSum="1">        <RelativeLayout          android:layout_width="wrap_content"          android:layout_height="wrap_content">        </RelativeLayout>        <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:id="@+id/Subcontractor"          android:padding="10dp"          android:text="SubContractors"          android:textSize="20sp"          android:textColor="@color/peru"          android:layout_alignParentTop="true" />        <EditText          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_margin="10dp"          android:background="@drawable/round_corner_square"          android:layout_weight="0.07" />          <RelativeLayout         android:layout_width="wrap_content"         android:layout_height="wrap_content">         </RelativeLayout>          <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:id="@+id/NumberPeople"          android:padding="10dp"          android:text="Number of Person"          android:textSize="20sp"          android:textColor="@color/peru"          android:layout_alignParentTop="true" />          <EditText          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_margin="10dp"          android:background="@drawable/round_corner_square"          android:layout_weight="0.07" />         <RelativeLayout          android:layout_width="wrap_content"          android:layout_height="wrap_content">         </RelativeLayout>             <TextView          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:id="@+id/NoHours"          android:padding="10dp"          android:text="Number of Hours"          android:textSize="20sp"          android:textColor="@color/peru"          android:layout_alignParentTop="true" />          <EditText          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:layout_margin="10dp"          android:background="@drawable/round_corner_square"          android:layout_weight="0.07" />    </LinearLayout>    

Output enter image description here

  1. When there are values on the editText, the text is a bit outside of the textField. How can I move the text right a bit ?

  2. How to move everything down a bit

  3. Reduce the gap between textView and editText

Can someone give me a hints ? Any help would be greatly appreciated.

No comments:

Post a Comment