scrollview which contains horizontal vertical linearlayout with weightsum not working properly -


[<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/activityroot"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context="com.weenggs.flora.choosepresentactivity">      <linearlayout         android:layout_width="match_parent"         android:layout_height="match_parent"         android:background="@drawable/bkgflowerselect"         android:orientation="vertical"         android:weightsum="1">          <linearlayout             android:id="@+id/top"             android:layout_width="match_parent"             android:layout_height="0dp"             android:layout_weight="0.15"             android:background="@drawable/top"             android:orientation="horizontal"             android:visibility="visible"></linearlayout>           <linearlayout             android:layout_width="match_parent"             android:layout_height="0dp"             android:layout_weight="0.85"             android:orientation="vertical">               <scrollview                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:fillviewport="false">                  <linearlayout                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:orientation="vertical"                     android:weightsum="1">                      <linearlayout                         android:layout_width="match_parent"                         android:layout_height="0dp"                         android:layout_weight="0.18"                         android:orientation="vertical">                           <linearlayout                             android:layout_width="match_parent"                             android:layout_height="match_parent"                             android:orientation="horizontal"                             android:weightsum="1">                               <linearlayout                                 android:layout_width="0dp"                                 android:layout_height="match_parent"                                 android:layout_weight="0.5">                                  <imageview                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:padding="10dp"                                     android:src="@drawable/bouquet" />                             </linearlayout>                               <linearlayout                                 android:layout_width="0dp"                                 android:layout_height="match_parent"                                 android:layout_weight="0.5"                                 android:orientation="vertical">                                  <linearlayout                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:orientation="vertical"                                     android:weightsum="1">                                       <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="0dp"                                         android:layout_marginbottom="15dp"                                         android:layout_margintop="25dp"                                         android:layout_weight="0.8"                                         android:background="@drawable/gradientcolor"                                         android:elevation="15dp"                                         android:orientation="horizontal">                                          <linearlayout                                             android:layout_width="0dp"                                             android:layout_height="match_parent"                                             android:layout_weight="0.6"                                             android:gravity="center|right">                                              <textview                                                 android:layout_width="match_parent"                                                 android:layout_height="match_parent"                                                 android:layout_marginright="25dp"                                                 android:gravity="center|right"                                                 android:text="40$"                                                 android:textcolor="@android:color/white"                                                 android:textsize="@dimen/price_text" />                                          </linearlayout>                                          <linearlayout                                             android:layout_width="0dp"                                             android:layout_height="match_parent"                                             android:layout_weight="0.4">                                              <imageview                                                 android:layout_width="wrap_content"                                                 android:layout_height="wrap_content"                                                 android:layout_gravity="center"                                                 android:src="@drawable/flowerselectnext" />                                         </linearlayout>                                       </linearlayout>                                      <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="0dp"                                         android:layout_weight="0.2">                                          <textview                                             android:layout_width="match_parent"                                             android:layout_height="match_parent"                                             android:text="total price including shipping , handling "                                             android:textsize="@dimen/below_price_text" />                                     </linearlayout>                                  </linearlayout>                               </linearlayout>                           </linearlayout>                      </linearlayout>                      <linearlayout                         android:layout_width="match_parent"                         android:layout_height="0dp"                         android:layout_weight="0.82"                         android:orientation="vertical">                          <linearlayout                             android:layout_width="match_parent"                             android:layout_height="match_parent"                             android:orientation="vertical">                              <view                                 android:layout_width="match_parent"                                 android:layout_height="1dp"                                 android:layout_marginbottom="5dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:background="#d1cfcb" />                               <textview                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_margintop="5dp"                                 android:layout_weight="0.07"                                 android:background="#fb9d11"                                 android:elevation="5dp"                                 android:gravity="center"                                 android:text="send gift to!"                                 android:textcolor="@color/colorwhite"                                 android:textsize="20dp"                                 android:textstyle="bold" />                              <linearlayout                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_weight="0.03"></linearlayout>                              <edittext                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.07"                                 android:background="@drawable/edittextdesign"                                 android:elevation="1dp"                                 android:hint="first name , last name"                                 android:paddingbottom="10dp"                                 android:paddingleft="10dp"                                 android:paddingtop="10dp" />                              <edittext                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.07"                                 android:background="@drawable/edittextdesign"                                 android:elevation="1dp"                                 android:hint="address"                                 android:paddingbottom="10dp"                                 android:paddingleft="10dp"                                 android:paddingtop="10dp" />                              <edittext                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.07"                                 android:background="@drawable/edittextdesign"                                 android:elevation="1dp"                                 android:hint="town"                                 android:paddingbottom="10dp"                                 android:paddingleft="10dp"                                 android:paddingtop="10dp" />                              <edittext                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.07"                                 android:background="@drawable/edittextdesign"                                 android:elevation="1dp"                                 android:hint="cap"                                 android:paddingbottom="10dp"                                 android:paddingleft="10dp"                                 android:paddingtop="10dp" />                               <edittext                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="20dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.15"                                 android:background="@drawable/edittextdesign"                                 android:elevation="1dp"                                 android:gravity="top|left"                                 android:hint="your special message"                                 android:paddingbottom="30dp"                                 android:paddingleft="10dp"                                 android:paddingtop="30dp"                                 android:textcolorhint="#ff8800" />                              <linearlayout                                  android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.15"                                 android:orientation="horizontal">                                  <imageview                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_weight="1.5"                                     android:src="@drawable/clock" />                                  <edittext                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_weight="1" />                             </linearlayout>                              <linearlayout                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_marginbottom="15dp"                                 android:layout_marginleft="20dp"                                 android:layout_marginright="20dp"                                 android:layout_weight="0.15"                                 android:orientation="horizontal">                                  <imageview                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_weight="1.5"                                     android:src="@drawable/calendar" />                                  <edittext                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_weight="1" />                             </linearlayout>                               <linearlayout                                 android:layout_width="match_parent"                                 android:layout_height="0dp"                                 android:layout_gravity="center"                                 android:layout_weight="0.13"                                 android:background="@drawable/footer"                                 android:gravity="center"                                 android:orientation="horizontal">                                  <linearlayout                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_weight="1"                                     android:gravity="center">                                      <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="match_parent"                                         android:layout_weight="1"                                         android:gravity="center">                                          <imageview                                             android:layout_width="wrap_content"                                             android:layout_height="wrap_content"                                             android:layout_gravity="center"                                             android:src="@drawable/flowerselectprevious" />                                     </linearlayout>                                      <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="match_parent"                                         android:layout_weight="1"                                         android:gravity="center">                                           <textview                                             android:layout_width="match_parent"                                             android:layout_height="match_parent"                                             android:layout_gravity="center"                                             android:gravity="center|left"                                             android:text="options"                                             android:textcolor="@android:color/white"                                             android:textsize="15sp"                                             android:textstyle="bold" />                                     </linearlayout>                                  </linearlayout>                                  <linearlayout                                     android:layout_width="match_parent"                                     android:layout_height="match_parent"                                     android:layout_gravity="center"                                     android:layout_weight="1"                                     android:gravity="center">                                      <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="match_parent"                                         android:layout_weight="1"                                         android:gravity="center">                                          <textview                                             android:layout_width="match_parent"                                             android:layout_height="match_parent"                                             android:layout_gravity="center"                                             android:gravity="center|right"                                             android:text="pay now"                                             android:textcolor="@android:color/white"                                             android:textsize="15sp"                                             android:textstyle="bold" />                                     </linearlayout>                                      <linearlayout                                         android:layout_width="match_parent"                                         android:layout_height="match_parent"                                         android:layout_gravity="center"                                         android:layout_weight="1"                                         android:gravity="center">                                          <imageview                                             android:id="@+id/pay_now"                                             android:layout_width="wrap_content"                                             android:layout_height="wrap_content"                                             android:layout_gravity="center"                                             android:src="@drawable/flowerselectnext" />                                     </linearlayout>                                  </linearlayout>                               </linearlayout>                           </linearlayout>                       </linearlayout>                  </linearlayout>             </scrollview>          </linearlayout>      </linearlayout>   </linearlayout> 

** layout getting stretched need below results **

need scroll without stretching layout

what happening layout getting stretch while running on mobile device performs same image below on emulator!!

** layout getting stretched need below results **

need scroll without stretching layout

what happening layout getting stretch while running on mobile device performs same image below on emulator!! image


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -