Listview width error, but it is wrap content - android

i have this rot to listview:
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:padding="8dp"
android:weightSum="2"
android:layout_marginLeft="18dp"
android:layout_marginTop="18dp"
android:layout_marginRight="18dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView2"
android:text="#string/brand"
android:gravity="center"
android:textSize="16dp"
android:textStyle="bold"
android:layout_margin="2dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvBrand"
android:text="MarcaTV"
android:gravity="center"
android:textSize="16dp"
android:textStyle="italic"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView4"
android:text="#string/type"
android:gravity="center"
android:textSize="16dp"
android:textStyle="bold"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvType"
android:text="TipoTV"
android:gravity="center"
android:textSize="16dp"
android:textStyle="italic"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView6"
android:text="#string/model"
android:gravity="center"
android:textSize="16dp"
android:textStyle="bold"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvModel"
android:gravity="center"
android:textSize="16dp"
android:text="ModelTV"
android:textStyle="italic"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView8"
android:text="#string/color"
android:gravity="center"
android:textSize="16dp"
android:textStyle="bold"
android:layout_margin="2dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvColor"
android:gravity="center"
android:textSize="16dp"
android:text="ColorTV"
android:textStyle="italic"
android:layout_margin="1dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView10"
android:text="#string/hand"
android:gravity="center"
android:textSize="16dp"
android:textStyle="bold"
android:layout_margin="2dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvHand"
android:gravity="center"
android:textSize="16dp"
android:textStyle="italic"
android:text="ManoTV"
android:layout_margin="1dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="0">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/tvPrice"
android:gravity="center"
android:textSize="32dp"
android:text="10,99"
android:layout_margin="8dp" />
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="#+id/textView"
android:gravity="center"
android:textSize="32dp"
android:text="€"
android:textStyle="bold"
android:layout_margin="8dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="0"
android:id="#+id/tvQty"
android:textSize="32dp"
android:layout_margin="8dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Unidades"
android:id="#+id/textView11"
android:textSize="16dp"
android:layout_margin="8dp"
android:textStyle="bold"
android:textIsSelectable="false" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:layout_marginRight="18dp"
android:background="#ffffff"
android:visibility="gone">
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/seekBar"
android:max="100"
android:progress="0"
android:layout_marginBottom="4dp" />
</LinearLayout>
</LinearLayout>
This must be show like this:
But it shows like this:
I dont know why have this margin on bottom...!!

Related

ScrollView laggs too much on scrolling android

i am using scrollview in Linearlayout , the problem is layout respond normally, as soon as i start scrolling, it laggs too much.
< LinearLayout >
< ScrollView >
< Linearlayout >..sub (LinearLayout)..< /LinearLayout >
< ScrollView>
< LinearLayout>
<?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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="vertical"
android:background="#drawable/round_edittext"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/proile_activity_unique_key_linearlayout_id"
>
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="20sp"
android:orientation="horizontal"
>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
>
</Spinner>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
i have used this code for my Linearlayout, As soon as i touch radioButton or edittext or i scrolldown, It start lagging alot. Im not able to understand the problem, the images i have used are small size below 100kb
I edited your code and took out about 4 LinearLayouts which were unnecessary. Please test it for performance. If it still is slow try substituting some of the remaining vertical LinearLayouts with RelativeLayouts as #IshitaShinha suggested.
<?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:background="#drawable/round_edittext"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/proile_activity_unique_key_linearlayout_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
android:layout_marginTop="20sp" />
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</ScrollView>

How to align textviews regarding to the layout background

I would like to know if there is a way to place all the textviews that start with little bit space regarding the layout they located. For example I want that in the follwoing image all the textvies will not touch in the border of layout sucah as the word "place","location","Between","When" are doing.
This is current situation:
and this is my xml code:
<?xml version="1.0" encoding="UTF-8"?>
<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="match_parent"
android:id="#+id/relativlayoutGcmMessage"
android:background="#ffffff">
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:id="#+id/separatorUp"
android:visibility="visible"
android:background="#FF0000"
android:layout_marginTop="25dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/textlayout"
android:layout_marginTop="5dp"
android:layout_below="#+id/separatorUp"
android:background="#drawable/edit_text_style_focused"
android:layout_margin="10dp"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User ,"
android:gravity="center"
android:id="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:textSize="20sp"
android:textColor="#FF0000" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="this is the message"
android:textSize="20sp"
android:layout_marginLeft="5dp"
android:layout_below="#+id/textViewUser"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000000" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<Button
android:text="Join"
android:id="#+id/ButtonJoin"
android:textColor="#ffffff"
android:background="#606060"
android:layout_margin="10dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
>
</Button>
<Button
android:text="Deny"
android:id="#+id/ButtonDeny"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:textColor="#ffffff"
android:background="#606060"
>
</Button>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:id="#+id/relativeLayoutTextVals"
android:layout_marginTop="20dp"
android:layout_margin="10dp"
android:background="#drawable/edit_text_style_focused"
android:layout_below="#+id/textlayout"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:id="#+id/row2"
android:layout_below="#+id/row1"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Between:"
android:id="#+id/textViewbtwn"
android:textColor="#FF0000"
android:textStyle="bold"
android:textSize="20sp"
android:layout_weight="0.62" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Time"
android:id="#+id/textViewtime"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_weight="1.45"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row3"
android:layout_below="#+id/row2"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Location:"
android:id="#+id/textViewloc"
android:textStyle="bold"
android:textColor="#FF0000"
android:textSize="20sp"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="place"
android:layout_marginLeft="10dp"
android:id="#+id/textViewPlace"
android:textSize="20sp"
android:layout_weight="2.28"
android:textColor="#000000" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:id="#+id/row1"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="When:"
android:id="#+id/textViewWhen"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="#FF0000"
android:layout_weight="51.15" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Date"
android:layout_marginLeft="10dp"
android:id="#+id/textViewDate"
android:textSize="20sp"
android:layout_weight="115.29"
android:textColor="#000000" />
</TableRow>
</RelativeLayout>
</RelativeLayout>
Try another approach as follows , it works as per your requirement
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/relativlayoutGcmMessage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<View
android:id="#+id/separatorUp"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:background="#FF0000"
android:visibility="visible" />
<RelativeLayout
android:id="#+id/textlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/separatorUp"
android:layout_margin="10dp"
android:layout_marginTop="5dp"
android:padding="10dp">
<TextView
android:id="#+id/textViewUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="User ,"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textViewUser"
android:layout_marginLeft="5dp"
android:text="this is the message"
android:textColor="#000000"
android:textSize="20sp" />
</RelativeLayout>
<LinearLayout
android:id="#+id/linearLayoutBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal">
<Button
android:id="#+id/ButtonJoin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Join"
android:textColor="#ffffff"></Button>
<Button
android:id="#+id/ButtonDeny"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="#606060"
android:text="Deny"
android:textColor="#ffffff">
</Button>
</LinearLayout>
<RelativeLayout
android:id="#+id/relativeLayoutTextVals"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textlayout"
android:layout_margin="10dp"
android:layout_marginTop="20dp">
<LinearLayout
android:id="#+id/row2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row1"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewbtwn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Between:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewtime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Time"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/row2"
android:layout_margin="5dp">
<TextView
android:id="#+id/textViewloc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Location:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewPlace"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="place"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/row1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_gravity="center"
android:layout_margin="5dp"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:id="#+id/textViewWhen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="When:"
android:textColor="#FF0000"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Date"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

ScrollView with RelativeLayout dont scroll to end

i have a ScrollView in android, inside it i have a RelativeLayout, my problem its the scroll doesnt go to the end and i cant see the last TextView.
This is the XML
<!-- Main layout -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".TabOrderActivity$OrderDetailFragment"
android:orientation="vertical"
android:background="#drawable/fondodroid2"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
android:weightSum="1">
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue_gg"
android:paddingTop="5dip">
<TextView
android:text="#string/orderDetail"
android:textSize="32sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:orientation="horizontal">
<TextView
android:text="Nº"
android:textSize="28sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textStyle="bold"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<TextView
android:id="#+id/file"
android:textSize="28sp"
android:layout_marginLeft="20dp"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginTop="10dp"
android:layout_weight="2.16"
android:layout_marginRight="0dp"
android:text="numero de orden" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:id="#+id/scrollView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
<TextView
android:id="#+id/policyHolderLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/customer"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:textSize="24dp"
android:layout_alignParentLeft="true"
android:layout_marginTop="0dp"
android:textStyle="bold" />
<TextView
android:id="#+id/policyHolder"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_toRightOf="#+id/policyHolderLabel"
android:gravity="left|top"
android:layout_marginLeft="10dp"
android:textSize="20sp" />
<TextView
android:id="#+id/cityLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/city"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/policyHolder"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:textSize="24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/city"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_toRightOf="#+id/cityLabel"
android:gravity="left|top"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_alignBottom="#+id/cityLabel" />
<TextView
android:id="#+id/provinceLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/province"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/city"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:textSize="24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/province"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:layout_toRightOf="#+id/provinceLabel"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_alignBottom="#+id/provinceLabel" />
<TextView
android:id="#+id/addressLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/address"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:textSize="24dp"
android:layout_below="#+id/province"
android:layout_alignParentLeft="true"
android:textStyle="bold" />
<TextView
android:id="#+id/address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:layout_toRightOf="#+id/addressLabel"
android:layout_marginLeft="10dp"
android:textSize="20sp"
android:layout_alignBottom="#+id/addressLabel" />
<TextView
android:id="#+id/zipCode"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:layout_toRightOf="#+id/addressLabel"
android:layout_below="#+id/address"
android:layout_marginLeft="10dp" />
<TextView
android:id="#+id/phonesLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/phones"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:layout_below="#+id/zipCode"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:textSize="24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/phone1"
android:inputType="phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|top"
android:textSize="20sp"
android:layout_toRightOf="#+id/phonesLabel"
android:layout_marginLeft="10dp"
android:layout_alignBottom="#+id/phonesLabel" />
<TextView
android:id="#+id/descriptionLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/description"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/phonesLabel"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:textSize="24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/descriptionLabel"
android:layout_below="#+id/descriptionLabel"
android:layout_marginTop="10dp"
android:editable="false"
android:inputType="textMultiLine"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:textSize="20sp"
android:layout_marginBottom="10dp" />
<TextView
android:id="#+id/coverageLabel"
style="#style/orderHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Cobertura"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_below="#+id/description"
android:layout_alignParentLeft="true"
android:layout_marginTop="10dp"
android:gravity="left|top"
android:textSize="24dp"
android:textStyle="bold" />
<TextView
android:id="#+id/coverage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/coverageLabel"
android:layout_below="#+id/coverageLabel"
android:layout_marginTop="10dp"
android:editable="false"
android:inputType="textMultiLine"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="left|top"
android:textSize="20sp"
android:layout_marginBottom="10dp" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
I tried to set a LinearLayout inside scrollview and the linearlayout contains the relative but i got the same result.
Whats wrong?
Try to change the margins to paddings:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
Hope this helps.

designing Custom tabs using linearlayout with child elements(Imageview,Textview)

I am creating custom tabs which consists of seven tabs using linear layout with imageview and Textview(Child elements) and giving weight equaly to seven tabs. But i need to set first tab width to remaining tabs so that it looks good.How to accompolish this. I am attaching screen shot for your kind reference.
XML File
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#000000">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="2dp"
android:scrollbarStyle="outsideInset"
android:scrollbarSize="1dp"
android:scrollbarThumbHorizontal="#android:color/darker_gray"
android:overScrollMode="never"
android:fadeScrollbars="false"
android:background="#0668b1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000000"
android:weightSum="7"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/ll_tab_wodetail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#464646"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_wodetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:adjustViewBounds="false"
android:src="#drawable/wo_wodetails" />
<TextView
android:id="#+id/tv_icon_wodetail"
style="?android:attr/tabWidgetStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="W/O Details"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_details"
android:background="#464646"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:src="#drawable/wo_details"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/tv_icon_wodetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Details"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_spares"
android:layout_weight="1"
android:background="#464646"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_spares"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/wo_spares"
android:gravity="center_horizontal"
android:layout_weight="1"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/tv_icon_spares"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Spares"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_tools"
android:background="#464646"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/wo_tools"
android:gravity="center_horizontal"
android:layout_weight="1"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/tv_icon_tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tools"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_tasks"
android:background="#464646"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/wo_tasks"
android:gravity="center_horizontal"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tasks"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_costs"
android:background="#464646"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_costs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/wo_costs"
android:gravity="center_horizontal"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/tv_icon_costs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Costs"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/ll_tab_trades"
android:background="#464646"
android:layout_weight="1"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_icon_trades"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:src="#drawable/wo_trades"
android:adjustViewBounds="false" />
<TextView
android:id="#+id/tv_icon_trades"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Trades"
android:textSize="16sp"
android:textColor="#ffffff"
style="?android:attr/tabWidgetStyle"
android:gravity="center_horizontal" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<ScrollView
android:id="#+id/sv_wodetails"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
android:background="#000000">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#000000">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/tv_wono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Work Oder No"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_wonoval"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:background="#drawable/spinner_background"
android:textColor="#ffffff"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_equipment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Equipment"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_equipmentval"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:background="#drawable/spinner_background"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_equipmenthier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Equipment Hierarchy"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_equipmenthierval"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:background="#drawable/spinner_background"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_jobdesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Job Description"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="#+id/et_jobdesc"
android:textColor="#ffffff"
android:background="#drawable/spinner_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:textSize="18sp">
<requestFocus />
</EditText>
<TextView
android:id="#+id/tv_instruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Instruction"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:textColor="#ffffff"
android:id="#+id/et_instruction"
android:background="#drawable/spinner_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:layout_marginTop="5dp"
android:textSize="18sp">
<requestFocus />
</EditText>
<TextView
android:id="#+id/tv_safetynotes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Safety Notes"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="#+id/et_safetynotes"
android:background="#drawable/spinner_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:layout_marginTop="5dp"
android:textSize="18sp">
<requestFocus />
</EditText>
<TextView
android:id="#+id/tv_wotype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="W/O Type"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/tv_wotypeval"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="WO TYPE"
android:textSize="18sp"
android:layout_marginTop="5dp"
android:background="#drawable/spinner_background"
android:textColor="#ffffff"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dip"
android:orientation="vertical" />
</LinearLayout>
</RelativeLayout>

how to prevent scrollview hiding other layout

clicking on edittext inside scrollview need to open other layout that should overlap scrollview(which occupies whole screen).But scrollview is hiding other layout.can anyone please give me a small hint.
<RelativeLayout
android:id="#+id/RLayout_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/RLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="#+id/homeButton"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_marginLeft="10dip"
android:layout_marginTop="10dip"
android:background="#drawable/home_icon" />
<TextView
android:id="#+id/textButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:background="#005288"
android:text="#string/MyProfile"
android:textColor="#ffffff" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout1"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/pickup_textView1"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="#string/Title"
android:textColor="#ffffff" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/pickup_textView1"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/MrRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Mr"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
<RadioButton
android:id="#+id/MrsRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Mrs"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
<RadioButton
android:id="#+id/MsRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Ms"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
</RadioGroup>
<TextView
android:id="#+id/required2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/radioGroup1"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout2"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/first_name"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/First_Name"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/firstNameEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/first_name"
android:imeOptions="actionDone"
android:inputType="text"
android:textSize="15sp" />
<TextView
android:id="#+id/required3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/firstNameEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout3"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/last_name"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/Last_Name"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/lastNameEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/last_name"
android:imeOptions="actionDone"
android:inputType="text"
android:textSize="15sp" />
<TextView
android:id="#+id/required4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/lastNameEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout4"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/email"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/E_Mail"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/eMailEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/email"
android:imeOptions="actionDone"
android:inputType="textWebEmailAddress"
android:textSize="15sp" />
<TextView
android:id="#+id/required5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/eMailEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<include
android:layout_gravity="bottom"
layout="#layout/picker" />
</LinearLayout>
try this
<RelativeLayout
android:id="#+id/RLayout_main"
android:layout_width="Fill_parent"
android:layout_height="Fill_parent" >
<RelativeLayout
android:id="#+id/RLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="#+id/homeButton"
android:layout_width="40dip"
android:layout_height="40dip"
android:layout_marginLeft="10dip"
android:layout_marginTop="10dip"
android:background="#drawable/home_icon" />
<TextView
android:id="#+id/textButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:background="#005288"
android:text="#string/MyProfile"
android:textColor="#ffffff" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout1"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/pickup_textView1"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="#string/Title"
android:textColor="#ffffff" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/pickup_textView1"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/MrRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Mr"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
<RadioButton
android:id="#+id/MrsRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Mrs"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
<RadioButton
android:id="#+id/MsRadio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/Ms"
android:textColor="#fff"
android:textSize="12sp"
android:textStyle="bold" >
</RadioButton>
</RadioGroup>
<TextView
android:id="#+id/required2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/radioGroup1"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout2"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/first_name"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/First_Name"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/firstNameEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/first_name"
android:imeOptions="actionDone"
android:inputType="text"
android:textSize="15sp" />
<TextView
android:id="#+id/required3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/firstNameEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout3"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/last_name"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/Last_Name"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/lastNameEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/last_name"
android:imeOptions="actionDone"
android:inputType="text"
android:textSize="15sp" />
<TextView
android:id="#+id/required4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/lastNameEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/RLayout5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/RLayout4"
android:layout_marginLeft="10dp" >
<TextView
android:id="#+id/email"
android:layout_width="100dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:text="#string/E_Mail"
android:textColor="#ffffff"
android:textSize="15sp" />
<EditText
android:id="#+id/eMailEditText"
android:layout_width="190dp"
android:layout_height="35dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/email"
android:imeOptions="actionDone"
android:inputType="textWebEmailAddress"
android:textSize="15sp" />
<TextView
android:id="#+id/required5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/eMailEditText"
android:gravity="center_vertical"
android:text="#string/star"
android:textColor="#ff0000"
android:textSize="18sp" />
</RelativeLayout>
</ScrollView>
<include
android:layout_gravity="bottom"
layout="#layout/picker"
android:layout_below="#+id/RLayout5"
/>
</RelativeLayout>
Use this code this will help u it has fixed header and footer in that there is Scroll
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:id="#+id/mainLinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#drawable/top_bg"
android:orientation="horizontal" >
<ImageView
android:id="#+id/back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/back_btn"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="75dp"
android:text="Flights"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/flightDetailsLayout"
android:layout_width="fill_parent"
android:layout_height="70dp"
android:layout_below="#+id/mainLinearLayout"
android:layout_centerHorizontal="true"
android:background="#drawable/gray_bg123"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/innerflightDetailsLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:paddingLeft="12dp"
android:textSize="12sp"
android:text="Delhi to Banglore, "
android:textStyle="bold" />
<TextView
android:id="#+id/tripType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="RoundTrip"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/innerTripLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/tripDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:textSize="10sp"
android:text="19 Jan 2013 "
android:textStyle="bold"/>
<TextView
android:id="#+id/paxText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="for 1 Adults,0 Childs,O Infants"
android:textSize="12dp" />
</LinearLayout>
<LinearLayout
android:id="#+id/Book"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/tripDate"
android:layout_width="84dp"
android:layout_height="wrap_content"
android:paddingLeft="12dp"
android:text="Rs 10,2345 /-"
android:textSize="14sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/bookBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_marginLeft="200dp"
android:src="#drawable/book" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/sortFlightLayouts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/flightDetailsLayout"
android:background="#drawable/gray_bg123"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DEL-BLR"
android:layout_marginLeft="6dp"
android:layout_marginTop="5dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:src="#drawable/flight_icon_result" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="25dp"
android:src="#drawable/time" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:src="#drawable/rupee" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="60dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/gray_bg123"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BLR-DEL"
android:layout_marginLeft="6dp"
android:layout_marginTop="5dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:src="#drawable/flight_icon_result" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="25dp"
android:src="#drawable/time" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:src="#drawable/rupee" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/footerLayout"
android:layout_below="#+id/sortFlightLayouts"
android:orientation="horizontal" >
<ListView
android:id="#+id/lvDepartures"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:choiceMode="singleChoice"
android:layout_height="wrap_content"
android:listSelector="#drawable/selection_effect"
android:layout_width="wrap_content"/>
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:background="#android:color/darker_gray" />
<ListView
android:id="#+id/lvArrivals"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:choiceMode="singleChoice"
android:layout_height="wrap_content"
android:listSelector="#drawable/selection_effect"
android:layout_width="wrap_content"/>
</LinearLayout>
<LinearLayout
android:id="#+id/footerLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:background="#drawable/top_bg" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
android:src="#drawable/filter" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
android:src="#drawable/sort" />
</LinearLayout>
</RelativeLayout>

Categories

Resources