How to use scroll view in relative layout which exist in fragment? - android

i am stuck how to scroll layout when keyboard appear? this is my static page but when my keyboard appear then my scrollview is not working.i can not give hard code height of scrollview. please help me..
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/settingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/splash_bg" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
</ScrollView>
Please help me out.
suggestions apreciated
Thanks Kind Regards.

Try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/splash_bg" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
And add this code to ypur manifest project:
<activity
android:name="YourActivity"
android:windowSoftInputMode="stateVisible|stateAlwaysVisible" >
</activity>

add this code in ur manifest activty
android:windowSoftInputMode="adjustPan|stateAlwaysVisible"

this code useful for scrolling relative layout..
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="#+id/settingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/splash_bg" >
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomRelay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="7.5dp"
android:background="#android:color/transparent"
android:visibility="gone" >
<TextView
android:id="#+id/Upload"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#ededed"
android:gravity="center"
android:text="Upload Photo"
android:textColor="#8F8F8F"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/Upload"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/choose_existing"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border1"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="1dp"
android:background="#ededed"
android:gravity="center"
android:text="Library"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/choose_existing"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/Camera"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border2"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="1dp"
android:background="#ededed"
android:gravity="center"
android:text="Camera"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border3"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/Camera"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border3"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:background="#ededed"
android:gravity="center"
android:text="Cancel"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>

Related

Adjusting Widgets in a Layout

Hey I have a ScrollView which allow users to input their credentials in the EditTexts inside. But there's one problem, one of the TextViews prior to its EditText consist of a Spinner but I do not know how to make that Spinner and the TextView side by side. Any help will be appreciated, thanks!:)
My xml:
<ScrollView
android:layout_width="344dp"
android:layout_height="495dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/textView39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Billing Address"
android:textSize="30dp" />
<TextView
android:id="#+id/textView38"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="20dp"
android:text="First Name"
android:textSize="16dp" />
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="10dp"
android:text="Last Name"
android:textSize="16dp" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView41"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="10dp"
android:text="Street"
android:textSize="16dp" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPostalAddress" />
<TextView
android:id="#+id/textView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Country"
android:layout_marginLeft="70dp"
android:layout_marginTop="10dp"
android:textSize="16dp" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="50dp"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
Try this,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
android:layout_width="344dp"
android:layout_height="495dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/textView39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Billing Address"
android:textSize="30dp" />
<TextView
android:id="#+id/textView38"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="20dp"
android:text="First Name"
android:textSize="16dp" />
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView40"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="10dp"
android:text="Last Name"
android:textSize="16dp" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPersonName" />
<TextView
android:id="#+id/textView41"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="10dp"
android:text="Street"
android:textSize="16dp" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:ems="10"
android:inputType="textPostalAddress" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/textView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:text="Country"
android:textSize="16dp" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="50dp"
android:layout_marginLeft="30dp"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Use Linear Layout after Edittext3 as:
<!--Use dimensions of your choice-->
<LinearLayout
android:orientation="horizontal"
<!-- TO display in center use android:layout_gravity="center" -->
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/textView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Country"
android:layout_marginLeft="70dp"
android:textSize="16dp" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="50dp"
android:layout_marginLeft="10dp"
android:layout_height="wrap_content" />
</LinearLayout>

How to fix background image with scrollView and textviews with edittext

How to fix background image with scrollview when windowSoftInputMode appears.
I used windowSoftInputMode="adjustPan",but scrollview doesn't work
completely, please help me. Last fields do not appear when virtual keyboard
appears.
I want that background image should not scroll up with virtual keyboard
and scrollview should show all the fields inside it while scrolling.
Here is my code
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#drawable/back">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/cancel_done_btn"
android:layout_marginLeft="30dp"
android:layout_marginTop="40dp"
android:textSize="17dp"
android:paddingTop="10dp"
android:textStyle="bold"
android:paddingBottom="10dp"
android:paddingLeft="28dp"
android:paddingRight="28dp"
android:text="#string/cancel"
android:id="#+id/btn_cancel_signin"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/cancel_done_btn"
android:layout_marginRight="30dp"
android:layout_marginTop="40dp"
android:textSize="17dp"
android:text="#string/done"
android:paddingTop="10dp"
android:textStyle="bold"
android:paddingBottom="10dp"
android:paddingLeft="35dp"
android:paddingRight="35dp"
android:layout_alignParentRight="true"
android:id="#+id/btn_done_signin"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:layout_marginLeft="40dp"
android:orientation="vertical"
android:layout_below="#+id/btn_cancel_signin">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="times new roman"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Tuesday,May"
android:textSize="25dp"
android:textStyle="bold"
android:id="#+id/tv_day_month" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="times new roman"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text=" 7,2016"
android:textSize="25dp"
android:textStyle="bold"
android:id="#+id/tv_date" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="200dp"
android:layout_marginLeft="130dp"
android:layout_below="#+id/btn_cancel_signin">
<ImageView
android:id="#+id/iv_signin_logo"
android:layout_width="200dp"
android:layout_height="180dp"
android:src="#drawable/sign_in_logo"
android:layout_marginTop="10dp" />
</LinearLayout>
<ScrollView
android:layout_width="350dp"
android:layout_height="wrap_content"
android:id="#+id/scroller_sign_in"
android:layout_below="#+id/btn_done_signin"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<LinearLayout
android:orientation="vertical"
android:paddingLeft="10dp"
android:layout_marginRight="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="30dp">
<TextView
android:layout_height="wrap_content"
android:text="First Name"
style="#style/sign_in_text"
android:id="#+id/label_firstname"
android:layout_alignParentLeft="true"
android:paddingTop="10dp"
android:inputType="textCapWords"
/>
<AutoCompleteTextView
android:id="#+id/et_firstname"
android:hint="Required"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
>
<TextView
android:layout_height="wrap_content"
android:text="Last Name"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_lastname"
android:paddingTop="10dp"
android:layout_alignParentLeft="true"
android:inputType="textCapWords"
/>
<AutoCompleteTextView
android:id="#+id/et_lastname"
android:hint="Required"
android:ems="10"
android:textSize="20dp"
android:textAllCaps="true"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_company"
>
<TextView
android:layout_height="wrap_content"
android:text="Company"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:layout_marginTop="10dp"
android:id="#+id/label_company"
android:layout_alignParentLeft="true"
/>
<AutoCompleteTextView
android:id="#+id/et_company"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:textAllCaps="true"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<!--android:background="#drawable/contact_edittext_bg"-->
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_address"
>
<TextView
android:layout_height="wrap_content"
android:text="Address"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_address"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_address"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_city"
>
<TextView
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:layout_height="wrap_content"
android:text="City"
android:id="#+id/label_city"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_city"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_state"
>
<AutoCompleteTextView
android:id="#+id/et_state"
android:ems="10"
android:textSize="20dp"
android:padding="10dp"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:inputType="textCapWords"/>
<TextView
android:layout_height="wrap_content"
android:text="State"
style="#style/sign_in_text"
android:id="#+id/label_state"
android:paddingTop="15dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp"
android:id="#+id/ll_zip_code"
>
<TextView
android:layout_height="wrap_content"
android:text="Zip Code"
android:layout_width="wrap_content"
android:paddingRight="10dp"
android:gravity="left"
android:id="#+id/label_zip_code"
android:paddingTop="15dp"
/>
<AutoCompleteTextView
android:id="#+id/et_zipcode"
android:ems="10"
android:layout_width="160dp"
android:background="#drawable/et_border"
android:textSize="20dp"
android:padding="10dp"
android:layout_height="wrap_content"
android:inputType="number"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
remove this from xml.
android:background="#drawable/back"
Write in your java file.
getWindow().setBackgroundDrawableResource(R.drawable.back);

Scrollview doesnot appears after putting it in xml file in android

Inside my xml file i put a scroll view. But it doesn't shows in my program. I was confused because i checked for any color problems. Here is my xml file, can anyone specifies the reason it doesn't shown at there?
Please note: some characters from textview and edittext are removed due to character limitation by stack overflow.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="#+id/rtop"
android:layout_width="wrap_content"
android:background="#drawable/top_transperant_bg" >
<Button
android:id="#+id/imageViewlogo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView3"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#android:color/transparent"
android:drawableTop="#drawable/icon_home"
android:paddingTop="5dp"
android:text="Your Home"
android:textColor="#c1c1c1" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
/>
</RelativeLayout>
<RelativeLayout
android:background="#drawable/bg_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/rtop"
android:layout_above="#+id/Rbottom"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:paddingTop="10dp"
>
<ScrollView
android:id="#+id/s1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/midle"
android:scrollbars="none"
android:fillViewport="true"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/Rcentre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/rela"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText3"
/>
<EditText
android:id="#+id/editText1"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="#dimen/Edittextheight"
android:layout_centerHorizontal="true"
android:layout_alignParentRight="true"
android:capitalize="words"
android:textSize="#dimen/font_size_normal" >
</EditText>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginTop="5dp"
android:inputType="textMultiLine"
android:maxLines="6"
android:text="Contact Person" />
<EditText
android:id="#+id/editText2"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="#dimen/Edittextheight"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:ems="10"
android:padding="5dp"
android:capitalize="words"
android:singleLine="true"
android:layout_alignParentRight="true"
android:textSize="#dimen/font_size_normal" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/checkBox3"
android:layout_marginTop="5dp"
android:text="Home Email" />
<EditText
android:id="#+id/editText4"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="#dimen/Edittextheight"
android:layout_alignLeft="#+id/textView5"
android:layout_below="#+id/textView5"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:editable="false"
android:ems="10"
android:focusable="false"
android:padding="5dp"
android:singleLine="true"
android:layout_alignParentRight="true"
android:textSize="#dimen/font_size_normal" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/checkBox1"
android:layout_marginTop="5dp"
android:text="Home Phone Number" />
<EditText
android:id="#+id/editText9"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="#dimen/Edittextheight"
android:layout_alignLeft="#+id/textView9"
android:layout_below="#+id/textView9"
<EditText
android:id="#+id/editText10"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
android:gravity="top"
android:imeOptions="actionDone"
android:lines="6"
android:maxLines="10"
android:padding="5dp"
android:scrollHorizontally="false"
android:layout_alignParentRight="true"
android:inputType="textCapSentences|textMultiLine"
android:scrollbars="vertical"
android:textSize="#dimen/font_size_normal" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText10"
android:layout_below="#+id/editText10"
android:layout_marginTop="5dp"
android:text="Residence Type" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="#dimen/Edittextwidth"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView6"
android:layout_alignParentRight="true"
android:layout_alignRight="#+id/editText10"
android:layout_below="#+id/textView6"
android:layout_marginTop="5dp"
android:background="#drawable/combo_bx"
android:padding="5dp"
android:popupBackground="#android:color/transparent"
android:spinnerMode="dropdown" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
/>
<CheckBox
android:id="#+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/textView4"
android:layout_below="#+id/editText4"
android:layout_marginTop="5dp"
android:text="Share my email address with other homeowners"
android:textColor="#FF0000"
android:visibility="gone"
android:textSize="#dimen/font_size_normal" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/editText9"
android:layout_below="#+id/editText9"
android:layout_marginTop="5dp"
android:text="Show my info to other residents"
android:textColor="#FFFFFF"
android:textSize="#dimen/font_size_normal" />
<CheckBox
android:id="#+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText2"
android:layout_marginTop="5dp"
android:text="Share my contact with other homeowners"
android:textColor="#FF0000"
android:visibility="gone"
android:textSize="#dimen/font_size_normal" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/spinner1"
android:layout_marginRight="40dp"
android:clickable="true"
android:text="Next>>"
android:visibility="gone" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/spinner1"
android:layout_marginTop="5dp" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="Vehicle Status "
android:textColor="#c1c1c1" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view1"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/radioButton2"
android:layout_toRightOf="#+id/textView5"
android:layout_marginBottom="5dp"
android:text=" Yes" />
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/textView5"
android:layout_marginTop="5dp"
android:background="#c1c1c1" />
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/view1"
android:layout_marginTop="5dp" >
<LinearLayout
android:id="#+id/firstvehicle"
android:layout_width="282dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="Make "
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclemake1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:ems="9"
android:padding="5dp"
android:inputType="textCapSentences"
android:textSize="#dimen/font_size_normal"
android:singleLine="true" />
<TextView
android:id="#+id/textView2more1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:background="#drawable/more_button"
android:clickable="true"
android:visibility="gone"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="Model "
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclemodel1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:ems="9"
android:layout_alignParentRight="true"
android:textSize="#dimen/font_size_normal"
android:inputType="textCapSentences"
android:padding="5dp"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="License"
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclenumber1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:ems="9"
android:padding="5dp"
android:inputType="textCapWords"
android:layout_alignParentRight="true"
android:textSize="#dimen/font_size_normal"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearcolour"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textColor="#c1c1c1"
android:text="Color " />
<EditText
android:id="#+id/colour"
android:singleLine="true"
android:ems="9" />
<TextView
android:id="#+id/textView2more"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="#drawable/more_button"
android:clickable="true"
android:gravity="center" />
</LinearLayout>
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="#c1c1c1" />
</LinearLayout>
<LinearLayout
android:id="#+id/mainLinearLayouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/firstvehicle"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_below="#+id/mainLinearLayouts"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="#drawable/buttoncolour"
android:onClick="submit"
android:text="Submit"
android:visibility="gone"
android:textColor="#c1c1c1" />
</RelativeLayout>
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/relativeLayout1"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="20dp"
android:text=" No" />
</RelativeLayout>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView7"
android:layout_alignLeft="#+id/textView1"
android:text="Address" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/editText1"
android:layout_below="#+id/textView8"
android:layout_marginTop="5dp"
android:background="#drawable/regtextfieldborder"
android:ems="10"
android:gravity="top"
android:inputType="textMultiLine|textCapSentences"
android:lines="5"
android:maxLines="6"
android:padding="5dp"
android:layout_centerHorizontal="true"
android:layout_alignParentRight="true"
android:textSize="#dimen/font_size_normal" >
</EditText>
<ImageView
android:id="#+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#c1c1c1"
android:padding="2dp"
android:src="#drawable/profile_image" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/midle"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
<Button
android:id="#+id/buttonsubmit"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:background="#drawable/buttoncolour"
android:gravity="center"
android:textColor="#c1c1c1"
android:text="Submit"/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/Rbottom"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" >
</RelativeLayout>
</RelativeLayout>
You used Some illegal character with XML
Also You have used some Empty views. That will not display proper output. and Each and every view must have height and width attribute in it. You missed in some.
I corrected some errors. This Might can help.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rtop"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#ff6700" >
<RelativeLayout
android:id="#+id/rtop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#80ff6700" >
<Button
android:id="#+id/imageViewlogo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView3"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="#android:color/transparent"
android:drawableTop="#drawable/ic_launcher"
android:paddingTop="5dp"
android:text="Your Home"
android:textColor="#c1c1c1" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/Rbottom"
android:layout_below="#+id/rtop"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#20ff6700"
android:paddingTop="10dp" >
<ScrollView
android:id="#+id/s1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:orientation="vertical"
android:scrollbars="none" >
<LinearLayout
android:id="#+id/Rcentre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:orientation="vertical" >
<RelativeLayout
android:id="#+id/rela"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText3" />
<EditText
android:id="#+id/editText1"
android:layout_width="80dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:capitalize="words"
android:textSize="10sp" >
</EditText>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginTop="5dp"
android:inputType="textMultiLine"
android:maxLines="6"
android:text="Contact Person" />
<EditText
android:id="#+id/editText2"
android:layout_width="80sp"
android:layout_height="20sp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:capitalize="words"
android:ems="10"
android:padding="5dp"
android:singleLine="true"
android:textSize="10sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/checkBox3"
android:layout_marginTop="5dp"
android:text="Home Email" />
<EditText
android:id="#+id/editText4"
android:layout_width="80dp"
android:layout_height="20dp"
android:layout_alignLeft="#+id/textView5"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView5"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:editable="false"
android:ems="10"
android:focusable="false"
android:padding="5dp"
android:singleLine="true"
android:textSize="10sp" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/checkBox1"
android:layout_marginTop="5dp"
android:text="Home Phone Number" />
<EditText
android:id="#+id/editText9"
android:layout_width="80dp"
android:layout_height="20dp"
android:layout_alignLeft="#+id/textView9"
android:layout_below="#+id/textView9" />
<EditText
android:id="#+id/editText10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:focusableInTouchMode="true"
android:gravity="top"
android:imeOptions="actionDone"
android:inputType="textCapSentences|textMultiLine"
android:lines="6"
android:maxLines="10"
android:padding="5dp"
android:scrollHorizontally="false"
android:scrollbars="vertical"
android:textSize="10dp" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText10"
android:layout_below="#+id/editText10"
android:layout_marginTop="5dp"
android:text="Residence Type" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView6"
android:layout_alignParentRight="true"
android:layout_alignRight="#+id/editText10"
android:layout_below="#+id/textView6"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:padding="5dp"
android:popupBackground="#android:color/transparent"
android:spinnerMode="dropdown" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox
android:id="#+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/textView4"
android:layout_below="#+id/editText4"
android:layout_marginTop="5dp"
android:text="Share my email address with other homeowners"
android:textColor="#FF0000"
android:textSize="10dp"
android:visibility="gone" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignRight="#+id/editText9"
android:layout_below="#+id/editText9"
android:layout_marginTop="5dp"
android:text="Show my info to other residents"
android:textColor="#FFFFFF"
android:textSize="10sp" />
<CheckBox
android:id="#+id/checkBox3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText2"
android:layout_marginTop="5dp"
android:text="Share my contact with other homeowners"
android:textColor="#FF0000"
android:textSize="10sp"
android:visibility="gone" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/spinner1"
android:layout_marginRight="40dp"
android:clickable="true"
android:text="Next>>"
android:visibility="gone" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/spinner1"
android:layout_marginTop="5dp" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="Vehicle Status "
android:textColor="#c1c1c1" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/view1"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp"
android:layout_toLeftOf="#+id/radioButton2"
android:layout_toRightOf="#+id/textView5"
android:text=" Yes" />
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/textView5"
android:layout_marginTop="5dp"
android:background="#c1c1c1" />
<RelativeLayout
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/view1"
android:layout_marginTop="5dp" >
<LinearLayout
android:id="#+id/firstvehicle"
android:layout_width="282dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="Make "
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclemake1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:ems="9"
android:inputType="textCapSentences"
android:padding="5dp"
android:singleLine="true"
android:textSize="10sp" />
<TextView
android:id="#+id/textView2more1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:background="#ff6700"
android:clickable="true"
android:gravity="center"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="Model "
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclemodel1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:ems="9"
android:inputType="textCapSentences"
android:padding="5dp"
android:singleLine="true"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="License"
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/vehiclenumber1"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:ems="9"
android:inputType="textCapWords"
android:padding="5dp"
android:singleLine="true"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearcolour"
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="Color "
android:textColor="#c1c1c1" />
<EditText
android:id="#+id/colour"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:ems="9"
android:singleLine="true" />
<TextView
android:id="#+id/textView2more"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="#ff6700"
android:clickable="true"
android:gravity="center" />
</LinearLayout>
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_marginTop="5dp"
android:background="#c1c1c1" />
</LinearLayout>
<LinearLayout
android:id="#+id/mainLinearLayouts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/firstvehicle"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="#+id/button1"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_below="#+id/mainLinearLayouts"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:onClick="submit"
android:text="Submit"
android:textColor="#c1c1c1"
android:visibility="gone" />
</RelativeLayout>
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/relativeLayout1"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp"
android:layout_marginRight="20dp"
android:text=" No" />
</RelativeLayout>
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView7"
android:text="Address" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignParentRight="true"
android:layout_alignRight="#+id/editText1"
android:layout_below="#+id/textView8"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="#ff6700"
android:ems="10"
android:gravity="top"
android:inputType="textMultiLine|textCapSentences"
android:lines="5"
android:maxLines="6"
android:padding="5dp"
android:textSize="10sp" >
</EditText>
<ImageView
android:id="#+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#c1c1c1"
android:padding="2dp"
android:src="#drawable/ic_launcher" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/midle"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp" >
<Button
android:id="#+id/buttonsubmit"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:background="#ff6700"
android:gravity="center"
android:text="Submit"
android:textColor="#c1c1c1" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/Rbottom"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" />
</RelativeLayout>

Scrollable Relative Layout does not show the bottom most part of the layout

I have a scrollable Android layout which is defined by the following code:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#id/horizontal_rule_in_registration" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="23dp" >
<View
android:id="#+id/advertising_image"
android:layout_width="306dp"
android:layout_height="175dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#drawable/inno_luck_sample_advertisement_picture" />
<TextView
android:id="#+id/advertiser_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertising_image"
android:layout_marginTop="12dp"
android:textColor="#color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/business_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_name_text"
android:layout_marginTop="12dp"
android:textColor="#color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/ad_description_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/business_text"
android:layout_marginTop="12dp"
android:maxLines="2"
android:singleLine="false"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_contact_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/ad_description_text"
android:layout_marginTop="12dp"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_address_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_contact_text"
android:layout_marginTop="12dp"
android:maxLines="2"
android:singleLine="false"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_website_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_address_text"
android:layout_marginTop="12dp"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<Button
android:id="#+id/next_ok_btn"
android:layout_width="190dp"
android:layout_height="29dp"
android:layout_below="#id/advertiser_website_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:background="#drawable/next_button_bg"
android:gravity="center"
android:text="#string/next"
android:textColor="#color/next_clr"
android:textSize="18sp" />
</RelativeLayout>
</ScrollView>
However as the picture below shows, this does not show the bottom most part of the layout.
How can I overcome this problem?
Try to give padding in your Relative layout
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="23dp"
android:paddingBottom="10dp">
try this code
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_below="#id/horizontal_rule_in_registration" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="23dp" >
<View
android:id="#+id/advertising_image"
android:layout_width="306dp"
android:layout_height="175dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#drawable/inno_luck_sample_advertisement_picture" />
<TextView
android:id="#+id/advertiser_name_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertising_image"
android:layout_marginTop="12dp"
android:textColor="#color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/business_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_name_text"
android:layout_marginTop="12dp"
android:textColor="#color/white"
android:textSize="18sp" />
<TextView
android:id="#+id/ad_description_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/business_text"
android:layout_marginTop="12dp"
android:maxLines="2"
android:singleLine="false"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_contact_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/ad_description_text"
android:layout_marginTop="12dp"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_address_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_contact_text"
android:layout_marginTop="12dp"
android:maxLines="2"
android:singleLine="false"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<TextView
android:id="#+id/advertiser_website_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/advertiser_address_text"
android:layout_marginTop="12dp"
android:textColor="#color/register_text_clr"
android:textSize="18sp" />
<Button
android:id="#+id/next_ok_btn"
android:layout_width="190dp"
android:layout_height="29dp"
android:layout_below="#id/advertiser_website_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:background="#drawable/next_button_bg"
android:gravity="center"
android:text="#string/next"
android:textColor="#color/next_clr"
android:textSize="18sp" />
</RelativeLayout>
hope this helps
try this for your ScrollView
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
....

How to do Android layout wrap with contents?

The contents of my android app are increasing from the layout portion, but I want to wrap the layout as contents are increasing. Can I adjust my all contents on a single relative layout or is this possible on any other layout?
Layout Code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/ttl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/ep"
android:textColor="#00ccff"
android:textSize="18sp"
android:textStyle="bold"
android:gravity="center"
android:layout_marginLeft="70dp"
android:layout_marginTop="15dp"
/>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/eprice"
android:layout_marginTop="64dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/ep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:text="#string/epval"
android:inputType="text"
android:layout_marginLeft="245dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/molcal"
android:layout_marginTop="100dp"
android:textColor="#00cc00"
android:textSize="18sp"
android:textStyle="bold"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/molfac"
android:layout_marginTop="135dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/molex"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="122dp"
android:text="#string/molex"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/frght"
android:layout_marginTop="180dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/frght"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="167dp"
android:text="#string/frghtport"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/whlfrg"
android:layout_marginTop="225dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/whar"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="212dp"
android:text="#string/whlfrgval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/storage"
android:layout_marginTop="270dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/storage"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="257dp"
android:text="#string/storageval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/expdev"
android:layout_marginTop="305dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/expdev"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="302dp"
android:text="#string/expdeval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/clear"
android:layout_marginTop="350dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/clear"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="347dp"
android:text="#string/clearval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/survey"
android:layout_marginTop="395dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/survey"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="392dp"
android:text="#string/surveyval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/transit"
android:layout_marginTop="440dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/transit"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="438dp"
android:text="#string/transitval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/total"
android:layout_marginTop="485dp"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/total"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginTop="483dp"
android:text="#string/totval"
android:inputType="text"
android:layout_marginLeft="230dp"
/>
</RelativeLayout>
Please Use below XML code instead of your code, it will solve your problem.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/ttl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="ep"
android:textColor="#00ccff"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:text="eprice"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/ep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="60dp"
android:inputType="text"
android:text="epval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:text="molcal"
android:textColor="#00cc00"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="135dp"
android:text="molfac"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/molex"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="122dp"
android:inputType="text"
android:text="molex" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="180dp"
android:text="frght"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/frght"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="167dp"
android:inputType="text"
android:text="frghtport" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="225dp"
android:text="whlfrg"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/whar"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="212dp"
android:inputType="text"
android:text="whlfrgval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="270dp"
android:text="storage"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/storage"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="257dp"
android:inputType="text"
android:text="storageval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="305dp"
android:text="expdev"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/expdev"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="302dp"
android:inputType="text"
android:text="expdeval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="350dp"
android:text="clear"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/clear"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="347dp"
android:inputType="text"
android:text="clearval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="395dp"
android:text="survey"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/survey"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="392dp"
android:inputType="text"
android:text="surveyval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="440dp"
android:text="transit"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/transit"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="438dp"
android:inputType="text"
android:text="transitval" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="485dp"
android:text="total"
android:textColor="#BBB000"
android:textSize="14sp"
android:textStyle="bold" />
<EditText
android:id="#+id/total"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="230dp"
android:layout_marginTop="483dp"
android:inputType="text"
android:text="totval" />
</RelativeLayout>
</ScrollView>
Ok it is a good question. You can set the layout height and width to wrap content and if you need to add other things you can use the following tags:
android:layout_below="#+id/textView1"
android:layout_above="#+id/textView1"
android:layout_toRightOf="#+id/textView1"
android:layout_toLeftOf="#+id/textView1"
According to me, Relative Layout is the best to use over others.

Categories

Resources