Layout not showing properly on 7" tablets(Android) - android

I developed an android application with reference to Nexus 7 in android studio preview which is 7" in size. The app is running with designed layout in some 7" tablets but not running with desired layouts in some other 7" tablets.
[![Display with layout being mixed up (iball Slide 7" tablet)][1]][1].
[![Dispay with proper layout(Micromax canvas P290 )][2]][2]
This is the xml code for layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="15dp"
android:focusableInTouchMode="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="15dp"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_below="#+id/chek"
android:background="#drawable/border_around"
android:layout_marginTop="10dp"
android:id="#+id/patient">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/date"
android:textSize="16sp"
android:text="Date :"/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/dateTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/date"
android:text="2/11/2016"
android:layout_marginLeft="18dp"
/>
<View
android:layout_width="1dp"
android:layout_height="60dp"
android:background="#c0c0c0"
android:id="#+id/viewa"
android:layout_toRightOf="#+id/dateTxt"
android:layout_marginLeft="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/id"
android:textSize="16sp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewa"
android:text="IP No :"/>
<TextView
android:layout_width="230dp"
android:layout_height="wrap_content"
android:id="#+id/idTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/id"
android:text="133245"
android:layout_marginLeft="20dp"
/>
<View
android:layout_width="1dp"
android:layout_height="60dp"
android:background="#c0c0c0"
android:id="#+id/viewb"
android:layout_toRightOf="#+id/idTxt"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/patientName"
android:layout_below="#id/date"
android:layout_marginTop="10dp"
android:text="Patient Name :"/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/patientNameTxt"
android:layout_below="#id/date"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/patientName"
android:text="Ravi Kumar"
android:layout_marginLeft="13dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/docName"
android:layout_below="#id/date"
android:layout_toRightOf="#+id/viewa"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:text="Primary Consultant :"/>
<TextView
android:layout_width="280dp"
android:layout_height="wrap_content"
android:id="#+id/docNameTxt"
android:textSize="16sp"
android:layout_below="#id/date"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/docName"
android:text="fddf"
android:layout_marginLeft="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/age"
android:textSize="16sp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewb"
android:text="Age :"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ageTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/age"
android:text="48"
android:layout_marginLeft="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/bednum"
android:textSize="16sp"
android:layout_below="#id/age"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewb"
android:text="Bed No :"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/bednumTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/bednum"
android:text="14"
android:layout_below="#id/age"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
/>
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#c0c0c0"
android:id="#+id/view1"
android:layout_below="#+id/patient"
android:layout_marginTop="20dp"/>
<ScrollView
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_below="#+id/view1"
android:layout_marginTop="30dp"
android:layout_marginBottom="10dp"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line1"
android:layout_marginLeft="60dp"
>
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/bed"
android:id="#+id/dailyassesment"
android:layout_toRightOf="#+id/nursingassessment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Handover Checklist"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_marginLeft="15dp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line3"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/line1">
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/nursingassesment"
android:id="#+id/nursingcare"
android:clickable="true"
android:layout_toRightOf="#+id/doctor"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Nursing Care Plans"
android:layout_below="#+id/nursingassessment"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_marginLeft="25dp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line4"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/line3">
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/graph"
android:id="#+id/vitalsigns"
android:layout_toRightOf="#+id/nursingassessment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Vital Signs Input"
android:layout_below="#+id/vitalsigns"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_marginLeft="35dp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
<!--<LinearLayout-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--android:id="#+id/line3"-->
<!--android:layout_marginLeft="20dp"-->
<!--android:layout_toRightOf="#+id/line2">-->
<!--<ImageView-->
<!--android:layout_width="180dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="#drawable/nursecare"-->
<!--android:id="#+id/nursingassessment"-->
<!--android:clickable="true"-->
<!--android:layout_toRightOf="#+id/doctor"-->
<!--/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="Nursing Initial Assesments"-->
<!--android:layout_below="#+id/nursingassessment"-->
<!--android:layout_marginTop="10dp"-->
<!--android:layout_toRightOf="#+id/calender"/>-->
<!--</LinearLayout>-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line5"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/line4">
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/doctor"
android:id="#+id/doctor"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Doctors Notes"
android:layout_below="#+id/doctor"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_marginLeft="40dp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line6"
android:layout_marginTop="30dp"
android:layout_marginLeft="60dp"
android:layout_below="#+id/line4"
>
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/bed"
android:id="#+id/dailyassesment1"
android:layout_toRightOf="#+id/nursingassessment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ISBAR Checklist-GW"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:textSize="17sp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/line7"
android:layout_marginTop="30dp"
android:layout_toRightOf="#+id/line6"
android:layout_marginLeft="30dp"
android:layout_below="#+id/line4"
>
<ImageView
android:layout_width="180dp"
android:layout_height="wrap_content"
android:src="#drawable/bed"
android:id="#+id/dailyassesment2"
android:layout_toRightOf="#+id/nursingassessment"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ISBAR-ICU"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_marginLeft="50dp"
android:layout_toRightOf="#+id/calender"/>
</LinearLayout>
</RelativeLayout>
</ScrollView>

Try this library for working with multiple screen resolutions it is easy to use and simply documented with sample code source

Here you go! scrollview will fit all sizes!! for the upper section you need to create seprated layout for different sizes! You can do it from the top menu in the designer page in android studio "create other variation" or manage it programmatically
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="15dp"
android:focusableInTouchMode="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="15dp"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_below="#+id/chek"
android:background="#drawable/delete"
android:layout_marginTop="10dp"
android:id="#+id/patient">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/date"
android:textSize="16sp"
android:text="Date :"/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/dateTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/date"
android:text="2/11/2016"
android:layout_marginLeft="18dp"
/>
<View
android:layout_width="1dp"
android:layout_height="60dp"
android:background="#c0c0c0"
android:id="#+id/viewa"
android:layout_toRightOf="#+id/dateTxt"
android:layout_marginLeft="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/id"
android:textSize="16sp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewa"
android:text="IP No :"/>
<TextView
android:layout_width="230dp"
android:layout_height="wrap_content"
android:id="#+id/idTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/id"
android:text="133245"
android:layout_marginLeft="20dp"
/>
<View
android:layout_width="1dp"
android:layout_height="60dp"
android:background="#c0c0c0"
android:id="#+id/viewb"
android:layout_toRightOf="#+id/idTxt"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/patientName"
android:layout_below="#id/date"
android:layout_marginTop="10dp"
android:text="Patient Name :"/>
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/patientNameTxt"
android:layout_below="#id/date"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/patientName"
android:text="Ravi Kumar"
android:layout_marginLeft="13dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/docName"
android:layout_below="#id/date"
android:layout_toRightOf="#+id/viewa"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:text="Primary Consultant :"/>
<TextView
android:layout_width="280dp"
android:layout_height="wrap_content"
android:id="#+id/docNameTxt"
android:textSize="16sp"
android:layout_below="#id/date"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/docName"
android:text="fddf"
android:layout_marginLeft="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/age"
android:textSize="16sp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewb"
android:text="Age :"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ageTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/age"
android:text="48"
android:layout_marginLeft="20dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/bednum"
android:textSize="16sp"
android:layout_below="#id/age"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_toRightOf="#+id/viewb"
android:text="Bed No :"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/bednumTxt"
android:textSize="16sp"
android:layout_toRightOf="#+id/bednum"
android:text="14"
android:layout_below="#id/age"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
/>
</RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="#c0c0c0"
android:id="#+id/view1"
android:layout_below="#+id/patient"
android:layout_marginTop="20dp"/>
<ScrollView
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_below="#+id/view1"
android:layout_marginTop="30dp"
android:layout_marginBottom="10dp"
>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
>
<LinearLayout
android:id="#+id/firstRow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line1"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/dailyassesment"
android:layout_toRightOf="#+id/nursingassessment" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Handover Checklist"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_toRightOf="#+id/calender"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line3"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/nursingcare"
android:clickable="true"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nursing Care Plans"
android:textSize="17sp"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line4"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/vitalsigns"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Vital Signs Input"
android:textSize="17sp"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
<!--<LinearLayout-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical"-->
<!--android:id="#+id/line3"-->
<!--android:layout_marginLeft="20dp"-->
<!--android:layout_toRightOf="#+id/line2">-->
<!--<ImageView-->
<!--android:layout_width="180dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:src="#drawable/nursecare"-->
<!--android:id="#+id/nursingassessment"-->
<!--android:clickable="true"-->
<!--android:layout_toRightOf="#+id/doctor"-->
<!--/>-->
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="Nursing Initial Assesments"-->
<!--android:layout_below="#+id/nursingassessment"-->
<!--android:layout_marginTop="10dp"-->
<!--android:layout_toRightOf="#+id/calender"/>-->
<!--</LinearLayout>-->
<LinearLayout
android:id="#+id/secondRow"
android:layout_below="#id/firstRow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line5"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/doctor"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Doctors Notes"
android:layout_below="#+id/doctor"
android:layout_marginTop="10dp"
android:textSize="17sp"
android:layout_toRightOf="#+id/calender"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line6"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/dailyassesment1"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ISBAR Checklist-GW"
android:textSize="17sp"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/line7"
android:layout_weight="1"
android:layout_margin="5dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#drawable/delete"
android:id="#+id/dailyassesment2"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ISBAR-ICU"
android:textSize="17sp"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

Replace your scrollview with the following code
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/line1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
>
<ImageView
android:id="#+id/dailyassesment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Handover Checklist"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/line3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="#+id/nursingcare"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Nursing Care Plans"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/line4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="#+id/vitalsigns"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Vital Signs Input"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/line5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="#+id/doctor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/doctor"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Doctors Notes"
android:textSize="17sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/line6"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_below="#+id/line4"
android:layout_marginTop="30dp"
android:orientation="vertical"
>
<ImageView
android:id="#+id/dailyassesment1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="ISBAR Checklist-GW"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/line7"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_below="#+id/line4"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"
android:orientation="vertical">
<ImageView
android:id="#+id/dailyassesment2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="ISBAR-ICU"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"></LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
Note: Replace your images... I am adding default launcher icons

Related

why is some space is remaining after swipe left and right in Listview

I swipe both side in Listview it successfully done but when when i swipe any side some space is vacant I can't find why is space is renaming: -
Space is renaming after secondary layout. Here is my child layout:-
<?xml version="1.0" encoding="utf-8"?>
<com.octalsoftaware.archi.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swipe="http://schemas.android.com/tools"
android:id="#+id/swipe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whitecolor">
<LinearLayout
android:id="#+id/delete_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/red_color"
android:orientation="horizontal"
android:paddingBottom="#dimen/_10sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:paddingTop="#dimen/_10sdp"
android:weightSum="3">
<LinearLayout
android:id="#+id/ll_charge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/left_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/red_color"
android:paddingBottom="#dimen/_10sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:paddingTop="#dimen/_10sdp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:id="#+id/ll_delete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginRight="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whitecolor"
android:orientation="vertical"
android:padding="#dimen/_10sdp"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_toLeftOf="#+id/img_arrow"
android:orientation="vertical">
<TextView
android:id="#+id/txt_settingname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lee Alexender"
android:textColor="#color/lightblack"
android:textSize="#dimen/_15sdp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/chargecircle" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:src="#drawable/qicircle" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:src="#drawable/cameracircle" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="#+id/img_arrow"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/arrow" />
</RelativeLayout>
</com.octalsoftaware.archi.daimajia.swipe.SwipeLayout>
You need to remove these lines in your LinearLayout
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
Add a FrameLayout as a direct child of SwipeLayout.
Add attribute android:layout_gravity="right" to delete_layout
Add attribute android:layout_gravity="left" to left_layout
Try this:
<?xml version="1.0" encoding="utf-8"?>
<com.octalsoftaware.archi.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swipe="http://schemas.android.com/tools"
android:id="#+id/swipe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whitecolor">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/delete_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/red_color"
android:orientation="horizontal"
android:paddingBottom="#dimen/_10sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:paddingTop="#dimen/_10sdp"
android:weightSum="3"
android:layout_gravity="right">
<LinearLayout
android:id="#+id/ll_charge"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:orientation="vertical"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/left_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/red_color"
android:paddingBottom="#dimen/_10sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:paddingTop="#dimen/_10sdp"
android:orientation="horizontal"
android:weightSum="2"
android:layout_gravity="left">
<LinearLayout
android:id="#+id/ll_delete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginRight="#dimen/_10sdp"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="#drawable/forbidden" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="#string/delete"
android:textColor="#android:color/white" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whitecolor"
android:orientation="vertical"
android:padding="#dimen/_10sdp"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_toLeftOf="#+id/img_arrow"
android:orientation="vertical">
<TextView
android:id="#+id/txt_settingname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lee Alexender"
android:textColor="#color/lightblack"
android:textSize="#dimen/_15sdp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/chargecircle" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:src="#drawable/qicircle" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:src="#drawable/cameracircle" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="#+id/img_arrow"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/arrow" />
</RelativeLayout>
</FrameLayout>
</com.octalsoftaware.archi.daimajia.swipe.SwipeLayout>

Not able to create responsive layout in android

I am creating a layout in android but I am not able to create a responsive layout. I have defined font size in pt but it distort on small screen. What should I do to make it responsive for all device. I have worst problem of font size. Screenshot on small screen is:
// My code
<?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="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:background="#drawable/background_car_detail"
android:elevation="#dimen/activity_8_margin"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<FrameLayout
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_margin="0dp"
android:layout_weight=".8"
android:background="#drawable/car">
<TextView
android:id="#+id/txtCertified"
style="#android:style/TextAppearance.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:layout_marginTop="#dimen/activity_8_margin"
android:alpha="0.5"
android:background="#drawable/btn_right_curve"
android:backgroundTint="#color/colorBlack"
android:paddingBottom="2dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="2dp"
android:text="Certified"
android:textColor="#color/colorWhite" />
<TextView
android:id="#+id/status"
style="#android:style/TextAppearance.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/activity_8_margin"
android:background="#drawable/btn_background"
android:backgroundTint="#color/colorPrimary"
android:paddingBottom="2dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="2dp"
android:text="Sold"
android:textColor="#color/colorWhite" />
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:layout_weight="1.2"
android:gravity="right"
android:orientation="vertical"
android:padding="#dimen/activity_horizontal_margin">
<TextView
android:id="#+id/carName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mahindra TUV300 T6 Plus"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:id="#+id/carKm"
style="#android:style/TextAppearance.DeviceDefault.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="29,6789 Km"
android:textSize="5pt" />
<View
android:layout_width="1dp"
android:layout_height="10dp"
android:layout_marginLeft="2pt"
android:layout_marginRight="2pt"
android:background="#000000" />
<TextView
android:id="#+id/carType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disel"
android:textSize="5pt" />
<View
android:layout_width="1dp"
android:layout_height="10dp"
android:layout_marginLeft="2pt"
android:layout_marginRight="2pt"
android:background="#000000" />
<TextView
android:id="#+id/carYear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2016"
android:textSize="5pt" />
</LinearLayout>
<TextView
android:id="#+id/carCondition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Condition: Excellent"
android:textSize="5pt" />
<TextView
android:id="#+id/carAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="Rs. 7.5L"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/carAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Singh car, Rajori Garden, Delhi"
android:textSize="5pt" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Check this out.
<?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="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:background="#drawable/rounded_corner_bg"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:orientation="horizontal"
android:weightSum="2"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:layout_weight=".8"
android:background="#drawable/com_facebook_button_like_background">
<TextView
android:id="#+id/txtCertified"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_gravity="top|left"
android:layout_marginTop="20dp"
android:background="#drawable/red_button_background"
android:padding="5dp"
android:text="Certified"
android:textColor="#color/colorAccent"
android:textSize="12sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true">
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/red_button_background"
android:gravity="end"
android:padding="5dp"
android:paddingBottom="2dp"
android:text="Sold"
android:textColor="#color/colorAccent" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:gravity="right|center"
android:orientation="vertical">
<TextView
android:id="#+id/carName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mahindra TUV300 T6 Plus"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp">
<TextView
android:id="#+id/carKm"
style="#android:style/TextAppearance.DeviceDefault.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="29,6789 Km"
android:textSize="5pt" />
<View
android:layout_width="1dp"
android:layout_height="10dp"
android:layout_marginLeft="2pt"
android:layout_marginRight="2pt"
android:background="#000000" />
<TextView
android:id="#+id/carType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disel"
android:textSize="5pt" />
<View
android:layout_width="1dp"
android:layout_height="10dp"
android:layout_marginLeft="2pt"
android:layout_marginRight="2pt"
android:background="#000000" />
<TextView
android:id="#+id/carYear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2016"
android:textSize="5pt" />
</LinearLayout>
<TextView
android:id="#+id/carCondition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Condition: Excellent"
android:textSize="5pt" />
<TextView
android:id="#+id/carAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="Rs. 7.5L"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/carAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="Singh car, Rajori Garden, Delhi"
android:textSize="5pt" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

Button Above linearlayout Android XML UI

I have this problem...
This is a screenshot of my XML File in Android Studio
this is the code...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/gris_300"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:scaleType="fitXY"
android:src="#drawable/image" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_below="#+id/imageView4"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="-50dp">
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/selector_oval"
android:text="AGREGAR ITEMS"
android:textColor="#color/white"
android:layout_below="#+id/imageView4"
android:layout_centerHorizontal="true"
android:layout_above="#+id/linearLayout3"
android:padding="10dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp" />
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#color/white"
android:clickable="false"
android:orientation="vertical"
android:layout_marginTop="-20dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll_ver_pedido"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/carrito" />
<TextView
android:id="#+id/textView19"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu3"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_estado"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_estado" />
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu1"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_llamar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_llamar" />
<TextView
android:id="#+id/textView23"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu7"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_mesa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_ver_mesa" />
<TextView
android:id="#+id/textView18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu2"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pedido" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Ver mi ticket"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_pagar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView22"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu6"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView43"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView46"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Mis rewards"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_uber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView42"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Llamar a un taxi/uber"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView54"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Regalar una gift card"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
and this is a screnshot of my device...
I tried Framelayout...relative...
Help!
Thanks!
Final code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#color/gris_300"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:scaleType="fitXY"
android:src="#drawable/image" />
<FrameLayout
android:layout_width="fill_parent"
android:layout_below="#+id/imageView4"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginTop="-30dp">
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#color/white"
android:clickable="false"
android:orientation="vertical"
android:layout_marginTop="20dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll_ver_pedido"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="50dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/carrito" />
<TextView
android:id="#+id/textView19"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu3"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_estado"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_estado" />
<TextView
android:id="#+id/textView6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu1"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_llamar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_llamar" />
<TextView
android:id="#+id/textView23"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu7"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_ver_mesa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_ver_mesa" />
<TextView
android:id="#+id/textView18"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu2"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pedido" />
<TextView
android:id="#+id/textView10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Ver mi ticket"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_pagar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView22"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="#string/text_menu6"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView43"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView46"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Mis rewards"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll_uber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView42"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Llamar a un taxi/uber"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_pagar" />
<TextView
android:id="#+id/textView54"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="Regalar una gift card"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<Button
android:id="#+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/selector_oval"
android:text="AGREGAR ITEMS"
android:textColor="#color/white"
android:layout_below="#+id/imageView4"
android:layout_centerHorizontal="true"
android:layout_above="#+id/linearLayout3"
android:padding="10dp"
android:layout_gravity="center_horizontal" />
</FrameLayout>

Bottom bar hides the scrollview content

Below code has a bottom bar with two buttons which is fixed and not scrollable.
Above bottom bar the layout is scrollable. But the bottom content in the ScrollView hides behind the bottom bar.
I tried changing the parent layout which was not fixing the issue.
I don't know where I am wrong. Any help would be really thankfull.
Code as follows
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginTop="0dp"
android:background="#drawable/toolbar_dropshadow" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fff"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical" >
<TextView
android:id="#+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<ImageView
android:id="#+id/image_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:background="#bcbcbc"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="#+id/price_full_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
<fone.adipoli.shopping.Rounded_textview
android:id="#+id/circle_txt"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginRight="70dp"
android:gravity="center"
android:padding="3dp"
android:text="" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#bcbcbc"></TextView>
<TextView
android:id="#+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Check Availability"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/item_available_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<EditText
android:id="#+id/enterpin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="2"
android:background="#drawable/edittext_border"
android:cursorVisible="false"
android:hint="Enter Pincode"
android:inputType="number"
android:padding="5dp" />
<Button
android:id="#+id/pincheck"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#000"
android:text="Check"
android:textColor="#color/white" />
</LinearLayout>
<RelativeLayout
android:id="#+id/chnge_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/item_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="14dp" />
<TextView
android:id="#+id/change_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:text="Change\nPincode"
android:textColor="#color/blue"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="Description :\n"
android:textColor="#000"
android:textSize="18dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/des_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:orientation="vertical">
<WebView
android:id="#+id/text_des"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Full details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<RelativeLayout
android:id="#+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="#+id/addtocart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Add to Cart"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:layout_width="2dp"
android:layout_height="wrap_content"></TextView>
<Button
android:id="#+id/buynow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Buy Now "
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
Remove whole of the first LinearLayout
Add the below line to your ScrollView
android:layout_above="#+id/bottom_bar"
This makes sure that your ScrollView ends before the bottom bar so theres no overlapping.
In your first LinearLayout add android:layout_above="#+id/bottom_bar"
this will help you
try this
Please try as below code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar"
android:layout_alignParentBottom="true"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#id/toolbar"
android:layout_alignParentTop="true"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginTop="0dp"
android:background="#drawable/toolbar_dropshadow" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fff"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical" >
<TextView
android:id="#+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<ImageView
android:id="#+id/image_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:background="#bcbcbc"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="#+id/price_full_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
<fone.adipoli.shopping.Rounded_textview
android:id="#+id/circle_txt"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginRight="70dp"
android:gravity="center"
android:padding="3dp"
android:text="" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#bcbcbc"></TextView>
<TextView
android:id="#+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Check Availability"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/item_available_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<EditText
android:id="#+id/enterpin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="2"
android:background="#drawable/edittext_border"
android:cursorVisible="false"
android:hint="Enter Pincode"
android:inputType="number"
android:padding="5dp" />
<Button
android:id="#+id/pincheck"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#000"
android:text="Check"
android:textColor="#color/white" />
</LinearLayout>
<RelativeLayout
android:id="#+id/chnge_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/item_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="14dp" />
<TextView
android:id="#+id/change_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:text="Change\nPincode"
android:textColor="#color/blue"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="Description :\n"
android:textColor="#000"
android:textSize="18dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/des_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:orientation="vertical">
<WebView
android:id="#+id/text_des"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Full details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<RelativeLayout
android:id="#+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="#+id/addtocart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Add to Cart"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:layout_width="2dp"
android:layout_height="wrap_content"></TextView>
<Button
android:id="#+id/buynow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Buy Now "
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
You should add tag android:layout_above="#id/bottom_bar" in your ScrollView
It will keep the scrolling above your bottom bar.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginTop="0dp"
android:background="#drawable/toolbar_dropshadow" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ScrollView
android:layout_above="#id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fff"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical" >
<TextView
android:id="#+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<ImageView
android:id="#+id/image_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:background="#bcbcbc"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="#+id/price_full_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
<fone.adipoli.shopping.Rounded_textview
android:id="#+id/circle_txt"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginRight="70dp"
android:gravity="center"
android:padding="3dp"
android:text="" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#bcbcbc"></TextView>
<TextView
android:id="#+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Check Availability"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/item_available_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<EditText
android:id="#+id/enterpin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="2"
android:background="#drawable/edittext_border"
android:cursorVisible="false"
android:hint="Enter Pincode"
android:inputType="number"
android:padding="5dp" />
<Button
android:id="#+id/pincheck"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#000"
android:text="Check"
android:textColor="#color/white" />
</LinearLayout>
<RelativeLayout
android:id="#+id/chnge_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/item_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="14dp" />
<TextView
android:id="#+id/change_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:text="Change\nPincode"
android:textColor="#color/blue"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="Description :\n"
android:textColor="#000"
android:textSize="18dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/des_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:orientation="vertical">
<WebView
android:id="#+id/text_des"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Full details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="#+id/addtocart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Add to Cart"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:layout_width="2dp"
android:layout_height="wrap_content"></TextView>
<Button
android:id="#+id/buynow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Buy Now "
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
use it:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginTop="0dp"
android:background="#drawable/toolbar_dropshadow" />
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fff"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical" >
<TextView
android:id="#+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<ImageView
android:id="#+id/image_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:background="#bcbcbc"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="#+id/price_full_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
<fone.adipoli.shopping.Rounded_textview
android:id="#+id/circle_txt"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginRight="70dp"
android:gravity="center"
android:padding="3dp"
android:text="" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#bcbcbc"></TextView>
<TextView
android:id="#+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Check Availability"
android:textAppearance="? android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/item_available_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<EditText
android:id="#+id/enterpin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="2"
android:background="#drawable/edittext_border"
android:cursorVisible="false"
android:hint="Enter Pincode"
android:inputType="number"
android:padding="5dp" />
<Button
android:id="#+id/pincheck"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#000"
android:text="Check"
android:textColor="#color/white" />
</LinearLayout>
<RelativeLayout
android:id="#+id/chnge_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/item_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="14dp" />
<TextView
android:id="#+id/change_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:text="Change\nPincode"
android:textColor="#color/blue"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="Description :\n"
android:textColor="#000"
android:textSize="18dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/des_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:orientation="vertical">
<WebView
android:id="#+id/text_des"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Full details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<RelativeLayout
android:id="#+id/bottom_bar"
android:layout_below:"#+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="#+id/addtocart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Add to Cart"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:layout_width="2dp"
android:layout_height="wrap_content"></TextView>
<Button
android:id="#+id/buynow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Buy Now "
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
Remove XMLNS from your scrollView, Give an id to scroll view. Then add attribute android:layout_below to the next component which is coming after scroll view.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:layout_marginTop="0dp"
android:background="#drawable/toolbar_dropshadow" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#fff"
android:id="#+id/scrol_view"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical" >
<TextView
android:id="#+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<ImageView
android:id="#+id/image_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:background="#bcbcbc"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="2">
<TextView
android:id="#+id/price_full_offer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Price"
android:textAppearance="? android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
<fone.adipoli.shopping.Rounded_textview
android:id="#+id/circle_txt"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginRight="70dp"
android:gravity="center"
android:padding="3dp"
android:text="" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="#bcbcbc"></TextView>
<TextView
android:id="#+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:text="Check Availability"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
<TextView
android:id="#+id/item_available_cart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<EditText
android:id="#+id/enterpin"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="2"
android:background="#drawable/edittext_border"
android:cursorVisible="false"
android:hint="Enter Pincode"
android:inputType="number"
android:padding="5dp" />
<Button
android:id="#+id/pincheck"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center|right"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:background="#000"
android:text="Check"
android:textColor="#color/white" />
</LinearLayout>
<RelativeLayout
android:id="#+id/chnge_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="#+id/item_available"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="15dp"
android:text=""
android:textSize="14dp" />
<TextView
android:id="#+id/change_pin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="50dp"
android:text="Change\nPincode"
android:textColor="#color/blue"
android:textSize="14dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:text="Description :\n"
android:textColor="#000"
android:textSize="18dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/des_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="0dp"
android:orientation="vertical">
<WebView
android:id="#+id/text_des"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Full details"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<RelativeLayout
android:id="#+id/bottom_bar"
android:layout_below="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/blue"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="#+id/addtocart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Add to Cart"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:layout_width="2dp"
android:layout_height="wrap_content"></TextView>
<Button
android:id="#+id/buynow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/blue"
android:text="Buy Now "
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>

split relative layout into two equal parts using linear layouts

I have a relative layout which contains two linear layouts. I want these two linear layouts to be placed in either halves of the relative layout containing them i.e. one to be positioned at top half and other at bottom half. Can anyone here help me with this. Here is the xml:
<RelativeLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
<ImageView
android:id="#+id/update_sn_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp" />
<TextView
android:id="#+id/update_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageView
android:id="#+id/update_message_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/update_sn_icon"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/update_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/update_message_pic"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:maxHeight="400dp"
android:scrollbars="vertical"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_after"
android:visibility="invisible">
<TextView
android:id="#+id/toggle_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/toggle_comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
<ListView
android:id="#+id/likes_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_below="#id/toggle_after"
android:padding="20dp"
/>
<ListView
android:id="#+id/comments_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_below="#id/toggle_after"
android:padding="20dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#id/comments_list"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_content"
android:layout_alignParentBottom="true">
<TextView
android:id="#+id/like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Try this..
<LinearLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
// Your Codes
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
// Your Codes
</LinearLayout>
</LinearLayout>
EDIT
<LinearLayout
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
android:background="#drawable/oneeventbkg" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout">
// Your Codes
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout">
// Your Codes
</RelativeLayout>
</LinearLayout>
// Try this way,hope this will help you to solve your problem...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/updatedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="#drawable/oneeventbkg" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/Top_half_layout"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/update_sn_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="10dp"
android:layout_marginTop="2dp" />
<TextView
android:id="#+id/update_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textColor="#android:color/white"
android:layout_gravity="right"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="#+id/update_message_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/update_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:maxHeight="400dp"
android:scrollbars="vertical"
android:textColor="#android:color/white"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/bottom_half_layout"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_after"
android:visibility="invisible">
<TextView
android:id="#+id/toggle_like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/toggle_comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/toggle_comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
<ListView
android:id="#+id/likes_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:padding="20dp" />
<ListView
android:id="#+id/comments_list"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:padding="20dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:id="#+id/toggle_content">
<TextView
android:id="#+id/like_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:text="1000"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_like_button_selctor" />
<TextView
android:id="#+id/comment_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="7dp"
android:text="100"
android:background="#android:color/transparent"
android:textColor="#android:color/white"
android:textSize="14sp" />
<ImageButton
android:id="#+id/comment_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/transparent"
android:src="#drawable/xml_comment_button_selector" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

Categories

Resources