When the items that I used started to fill whole screen I decided to use scrollview,but when I use it,ScrollView compressing the layouts of items and put them in a smaller part of screen as the following:
And here is my xml.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#A4A4A4">
<ScrollView
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">
<ImageView
android:id="#+id/imageview"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="#+id/image_button"
android:layout_width="40dp"
android:layout_height="48dp"
android:layout_marginRight="-9dp"
android:src="#drawable/home_ico"
/>
<Button
android:id="#+id/internet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9sp"
android:layout_marginRight="-9dp"
android:text="#string/internet"
android:textColor="#ffffff"
android:layout_weight="1"/>
<Button
android:id="#+id/servisler"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9sp"
android:layout_marginRight="-9dp"
android:text="#string/servisler"
android:textColor="#ffffff"
android:layout_weight="1"/>
<Button
android:id="#+id/kampanya"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9sp"
android:layout_marginRight="-9dp"
android:text="#string/kampanya"
android:textColor="#ffffff"
android:layout_weight="1"/>
<Button
android:id="#+id/hakkımızda"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9sp"
android:layout_marginRight="-9dp"
android:text="#string/hakkımızda"
android:textColor="#ffffff"
android:layout_weight="1"/>
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="9sp"
android:layout_marginRight="-9dp"
android:textColor="#ffffff"
android:text="Diğer" />
</LinearLayout>
<LinearLayout
android:layout_height="0dp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_weight="0.5">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.8">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
/>
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="bottom"
android:padding="5dp"
app:centered="true"
app:fillColor="#ff0099"
app:pageColor="#FF0000"
app:snap="false" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:orientation="vertical">
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView4"/>
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView5"/>
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView6"/>
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView7"/>
<TextView
android:id="#+id/textView8"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView8"/>
<TextView
android:id="#+id/textView9"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:text="#string/textView9"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF0000FF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="wefwfw"/>
<ImageView
android:id="#+id/image"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:drawable="#drawable/adsl"/>
<TextView
android:layout_gravity="bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
<TextView
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#FF0000FF" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="wefwfw"/>
<ImageView
android:id="#+id/image2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:drawable="#drawable/adsl"/>
<TextView
android:layout_gravity="bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
<TextView
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF0000FF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="wefwfw"/>
<ImageView
android:id="#+id/image3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:drawable="#drawable/adsl"/>
<TextView
android:layout_gravity="bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
<TextView
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="#FF0000FF" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:orientation="vertical">
<TextView
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="wefwfw"/>
<ImageView
android:id="#+id/image4"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.8"
android:drawable="#drawable/adsl"/>
<TextView
android:layout_gravity="bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
<TextView
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="qwgq"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF0000FF" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
So what is my problem?
Thanks in advance...
Related
I am working on android app
and i have cart activity which have multi row of products
and then the total of cart and button to continue..
This layout have top and buttom bars and then Scrollview have linearLayout as child...
This child contain:
Recyclerview
Textboxes
Button
My problem is: I cant scroll to the last item in my layout (The Button) .
This is my xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_alignParentTop="true">
<ImageView
android:id="#+id/ProgressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:src="#drawable/progress_rec"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="#+id/overview_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/backgroudn"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/tt"
>
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "70dp"
android:elevation="12dp"
android:padding="8dp"
android:background="#drawable/white_action_bar"
android:id="#+id/first"
android:orientation="horizontal"
android:weightSum="1">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:elevation="12dp"
android:id="#+id/btnActionBar11"
android:drawableStart="#drawable/ic_arrow_back_black_24dp"
android:drawableLeft="#drawable/ic_arrow_back_black_24dp"
android:drawablePadding="8dp"
android:drawableTint="#color/colorPrimaryDark"
android:padding="8dp"
android:background="#android:color/transparent"
android:layout_weight="0.2" />
<TextView
android:layout_width = "0dp"
android:layout_height = "wrap_content"
android:gravity="center"
android:textSize="14sp"
android:padding="8dp"
android:text="#string/cart"
android:layout_marginTop="8dp"
android:id="#+id/tvActionBar"
android:textColor="#color/colorPrimaryDark"
android:layout_weight="0.5"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:id="#+id/btnActionBarEnd11"
android:padding="8dp"
android:drawableEnd="#drawable/ic_shopping_cart_black_24dp"
android:drawableRight="#drawable/ic_shopping_cart_black_24dp"
android:drawablePadding="8dp"
android:drawableTint="#color/colorPrimaryDark"
android:textColor="#color/colorPrimaryDark"
android:background="#android:color/transparent"
android:layout_weight="0.3"
android:textSize="12sp"
android:visibility="gone"/>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:layout_below="#+id/first">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/no_data"
android:text="#string/no_data"
android:textSize="24sp"
android:textAlignment="center"
android:gravity="center"
android:textColor="#color/colorPrimary"
android:visibility="gone"/>
<ProgressBar
android:foregroundGravity="center"
android:id="#+id/progress"
android:layout_below="#+id/no_data"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#android:color/transparent"
android:layout_gravity="center"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/cartContentList"
android:layoutAnimation="#anim/layout_animation"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
android:weightSum="1"
android:id="#+id/totalLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="#string/total"
android:textSize="#dimen/medium"
android:textColor="#color/colorPrimaryDark"
android:gravity="center"
/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:text="#string/zero_dollar"
android:textSize="#dimen/medium"
android:textColor="#color/colorPrimaryDark"
android:gravity="center"
android:id="#+id/tvTotal"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/round_button"
android:text="#string/continue_"
android:textColor="#color/white"
android:textSize="#dimen/medium"
android:layout_margin="8dp"
android:padding="8dp"
android:gravity="center"
android:id="#+id/btnContinue" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="8dp"
android:paddingTop="8dp"
android:id="#+id/any"
android:background="#drawable/white_menu_bar"
android:layout_alignParentBottom="true"
android:elevation="24dp">
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "40dp"
android:elevation="12dp"
android:padding="2dp"
android:id="#+id/end"
android:orientation="horizontal"
android:weightSum="1"
android:gravity="center_horizontal">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#android:color/transparent"
android:drawableTop="#drawable/home_1"
android:layout_margin="8dp"
android:gravity="center"
android:layout_gravity="center"
android:textColor="#color/colorPrimaryDark"
android:paddingEnd="15dp"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#android:color/transparent"
android:textColor="#color/colorPrimaryDark"
android:gravity="center"
android:layout_gravity="center"
android:id="#+id/btnMyOrder"
android:drawableTop="#drawable/my_orders_1"
android:layout_margin="8dp"
android:paddingEnd="15dp"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#android:color/transparent"
android:textColor="#color/colorPrimaryDark"
android:gravity="center"
android:layout_gravity="center"
android:drawableTop="#drawable/notifications_1"
android:layout_margin="8dp"
android:paddingEnd="18dp"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="#android:color/transparent"
android:drawableTop="#drawable/side_menu_1"
android:layout_marginTop="8dp"
android:drawableTint="#color/colorPrimaryDark"
android:layout_gravity="center"
android:paddingEnd="15dp"/>
</LinearLayout>
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "20dp"
android:elevation="12dp"
android:id="#+id/end1"
android:orientation="horizontal"
android:weightSum="1"
android:gravity="center_horizontal">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:id="#+id/gr1Home1"
android:drawableTop="#drawable/component1"
android:background="#android:color/transparent"
android:layout_weight="0.25"
android:paddingTop="8dp"
android:drawablePadding="15dp"
android:visibility="visible"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:id="#+id/gr2Notification1"
android:drawableTop="#drawable/component1"
android:background="#android:color/transparent"
android:layout_weight="0.25"
android:padding="8dp"
android:drawablePadding="15dp"
android:visibility="invisible"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:id="#+id/gr3Message1"
android:drawableTop="#drawable/component1"
android:background="#android:color/transparent"
android:layout_weight="0.25"
android:padding="8dp"
android:drawablePadding="15dp"
android:visibility="invisible"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:id="#+id/gr4Calender1"
android:drawableTop="#drawable/component1"
android:background="#android:color/transparent"
android:layout_weight="0.25"
android:padding="8dp"
android:drawablePadding="15dp"
android:visibility="invisible"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
.
This is my Cart Activity XMl:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cart_bg"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cart_bg"
android:orientation="vertical">
<include
android:id="#+id/abl_main1"
layout="#layout/app_header_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<LinearLayout
android:id="#+id/ll_item_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/abl_main1"
android:orientation="horizontal">
<TextView
android:id="#+id/tv_item_count_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/montserrat"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:text="#string/my_cart"
android:textColor="#color/text_item"
android:textSize="#dimen/text_size_18"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_item_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/montserrat"
android:paddingLeft="0dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:text="#string/my_cart"
android:textColor="#color/gray_9E"
android:textSize="#dimen/text_size_12"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_total"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:padding="10dp"
android:text="#string/total_caps"
android:textColor="#color/text_item"
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/ll_item_count">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="60dp"
android:visibility="visible">
<LinearLayout
android:id="#+id/ll_listing"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="visible">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rcv_cart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:background="#android:color/transparent"
android:clipToPadding="false"
android:orientation="vertical"
android:visibility="visible"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<androidx.cardview.widget.CardView
style="#style/CardView.Light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="#color/white"
app:cardCornerRadius="4dp">
<LinearLayout
android:id="#+id/ll_playable"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:text="#string/cart_total"
android:textColor="#color/text_item"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_cart_total"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:text=""
android:textColor="#color/text_item"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:text="#string/total"
android:textColor="#color/text_item"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_sub_total"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:text=""
android:textColor="#color/text_item"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:text="#string/discount"
android:textColor="#color/text_item"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_discount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:text=""
android:textColor="#color/text_item"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:text="#string/dilivery"
android:textColor="#color/text_item"
android:textStyle="normal" />
<TextView
android:id="#+id/tv_delivery"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:text=""
android:textColor="#color/text_item"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:text="#string/total_payable"
android:textColor="#color/text_item"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_payable"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="#font/montserrat"
android:gravity="right"
android:text=""
android:textColor="#color/text_item"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/montserrat"
android:maxLines="2"
android:text="#string/tax_and_shipping_calculated"
android:textColor="#color/text_item"
android:textSize="#dimen/text_size_15"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin5dp"
android:fontFamily="#font/montserrat"
android:text="#string/add_order_note"
android:textColor="#color/text_item" />
<EditText
android:id="#+id/ed_order_note"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/shape_rectangle_transperant_bg_app_color_border"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="top|left"
android:hint="#string/how_can_we_help_you"
android:imeOptions="actionDone"
android:isScrollContainer="false"
android:lines="3"
android:maxLines="3"
android:overScrollMode="always"
android:padding="#dimen/margin5dp"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:textColor="#color/text_item" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/rr_empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/ll_item_count"
android:layout_centerInParent="true"
android:background="#color/white"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:id="#+id/ll_backgorund_circle_cart"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:background="#drawable/circle_drawable"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/iv_background_icon_cart"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:src="#mipmap/iv_red_heart"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="#+id/tv_empty_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/padding_10"
android:layout_marginTop="#dimen/text_size_20"
android:layout_marginRight="#dimen/padding_10"
android:fontFamily="#font/montserrat"
android:gravity="center"
android:text="#string/your_bag_is_empty"
android:textColor="#color/text_item"
android:textSize="20dp"
android:textStyle="bold"
android:visibility="visible" />
<TextView
android:id="#+id/tv_empty_sub_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/padding_10"
android:layout_marginTop="#dimen/padding_10"
android:layout_marginRight="#dimen/padding_10"
android:layout_marginBottom="30dp"
android:fontFamily="#font/montserrat"
android:gravity="center"
android:text="#string/item_added_to_bag"
android:textColor="#color/gray_9E"
android:textSize="16dp"
android:textStyle="normal"
android:visibility="visible" />
<LinearLayout
android:id="#+id/ll_shopping_now"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/shape_rectangle_transperant_bg_app_color_border_new"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
android:id="#+id/tv_shopping_now"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/input_layout_password"
android:layout_alignParentStart="true"
android:layout_gravity="center_horizontal"
android:fontFamily="#font/montserrat"
android:gravity="center"
android:padding="#dimen/padding_10"
android:text="#string/shopping_now"
android:textColor="#color/black"
android:textSize="16dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<View
android:id="#+id/v_order_place"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="#+id/ll_place_order"
android:background="#color/light_gray" />
<LinearLayout
android:id="#+id/ll_place_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight=".5"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp">
<TextView
android:id="#+id/tv_place_order_total"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="#font/montserrat"
android:gravity="center"
android:text=""
android:textColor="#color/text_item"
android:textStyle="bold" />
</LinearLayout>
<com.wpa3.productshopify.util.RippleView
rv_centered="true"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".5"
app:rv_type="rectangle"
app:rv_zoom="true">
<TextView
android:id="#+id/tv_place_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="5dp"
android:layout_weight=".5"
android:background="#drawable/shape_round_corner_rectangle"
android:fontFamily="#font/montserrat"
android:gravity="center"
android:padding="10dp"
android:text="#string/place_order"
android:textAllCaps="true"
android:textColor="#color/white"
android:textSize="15sp" />
</com.wpa3.productshopify.util.RippleView>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Right now i'm busy so did not seen your XML but check my code snippet.
Hope this may help you
I've searched through the site but haven't found a similar question. I have finished making this layout, and then I proceeded to make some changes in my code (not regarding the layout), and when I came back to content_main.xml, the layout decided not to render. The solution seems to be when I remove this line:
tools:showIn="#layout/activity_main"
Then the layout renders, of course, without the toolbar. The layout is slightly complicated, but it worked fine up until now, and I haven't changed anything in the toolbar layout. Where should I look? In the content_main.xml,activity_main, or where? Also, I can post whatever piece of code might be relevant to this problem. But I do not know what is relevant and what isn't, so instead of posting 500 xml lines of code, (plus 2600 lines in java), I'm not going to post until someone tells me what might be the problem.
EDIT
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.example.samprocreativecenter.nfc.MainActivity"
android:orientation="horizontal"
android:background="#819fba">
<!-- tools:showIn="#layout/activity_main"
-->
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:background="#drawable/ekran"
android:clickable="false">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="end"
android:id="#+id/txtStatus"
android:textColor="#ffffff"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:textSize="28sp"
android:textColor="#ffffff"
android:id="#+id/editUnos"
android:fontFamily="sans-serif-thin"
android:gravity="bottom|end"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:id="#+id/layoutTasteri"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img1"
android:src="#drawable/p1"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img2"
android:src="#drawable/p2"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img3"
android:src="#drawable/p3"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img4"
android:src="#drawable/p4"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img5"
android:src="#drawable/p5"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img6"
android:src="#drawable/p6"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img7"
android:src="#drawable/p7"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img8"
android:src="#drawable/p8"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img9"
android:src="#drawable/p9"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgNazad"
android:src="#drawable/delete"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/img0"
android:src="#drawable/p0"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgEnter"
android:src="#drawable/enter"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_width="30dp"
android:layout_height="match_parent"
android:src="#drawable/linija"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:visibility="gone"
android:id="#+id/layoutOtvorenListView"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="18dp"
android:id="#+id/txtSmanjiListView"
android:background="#607b9a"
android:text="Info panel"
android:textColor="#d9e8e7"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listViewOtvoreni"
android:stackFromBottom="true">
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:id="#+id/layoutSredina">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<TextClock
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="60sp"
android:id="#+id/textClock"
android:textColor="#ffffff"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="27sp"
android:id="#+id/txtDatum"
android:gravity="center"
android:textColor="#ffffff"
android:fontFamily="sans-serif-thin"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:id="#+id/layoutSredinaPodesavanja"
android:visibility="gone"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/imgUspesnaVerifikacija"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:text="Domen"
android:id="#+id/domen"
android:textColor="#ffffff"
android:textSize="12sp"/>
<EditText
android:layout_below="#+id/domen"
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="27dp"
android:textColor="#ffffff"
android:background="#drawable/unos_polje_neaktivno"
android:textColorHint="#a6bbce"
android:singleLine="true"
android:maxLines="1"
android:id="#+id/editDomen"/>
<TextView
android:layout_below="#+id/editDomen"
android:layout_marginTop="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/server"
android:text="Adresa servera"
android:textColor="#ffffff"
android:textSize="12sp"/>
<EditText
android:layout_below="#+id/server"
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="27dp"
android:background="#drawable/unos_polje_neaktivno"
android:textColor="#ffffff"
android:maxLines="1"
android:textColorHint="#a6bbce"
android:id="#+id/editServer"/>
<ImageView
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_gravity="end"
android:id="#+id/imgVerifikacija"
android:src="#drawable/verifikacija"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.7"
android:orientation="vertical"
android:id="#+id/layoutSredinaDole"
android:visibility="visible">
<Spinner
android:layout_width="0dp"
android:layout_height="0dp"
android:id="#+id/spnMestoTroska"
android:spinnerMode="dropdown"
android:layout_gravity="start"
>
</Spinner>
<TextView
android:layout_width="120dp"
android:layout_height="70dp"
android:layout_gravity="center"
android:background="#drawable/mesto_troska"
android:id="#+id/txtSpinner"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="18dp"
android:background="#drawable/rsz_prologin_pocetna_1"
android:id="#+id/txtListView"/>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listView">
</ListView>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/layoutDesniPodesavanja"
android:visibility="gone"
>
<TextView
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="Rezim sinhronizacije"
android:textSize="13sp"
android:textColor="#a6bbce"
android:id="#+id/rezim"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:textSize="13sp"
android:textColor="#ffffff"
android:id="#+id/txtSinhronizacija"
android:layout_below="#+id/rezim"/>
<ImageView
android:layout_marginStart="5dp"
android:layout_width="55dp"
android:layout_height="40dp"
android:layout_alignParentEnd="true"
android:layout_alignTop="#+id/rezim"
android:id="#+id/imgSinhronizuj"
android:src="#drawable/sinhronizuj"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:singleLine="true"
android:layout_below="#+id/imgSinhronizuj"
android:textSize="9sp"
android:text="Sinhronizuj"
android:layout_alignStart="#+id/imgSinhronizuj"
android:layout_marginStart="8dp"
android:id="#+id/sinhronizuj"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rezim rada terminala:"
android:textColor="#a6bbce"
android:layout_marginStart="10dp"
android:textSize="13sp"
android:layout_below="#+id/sinhronizuj"
android:layout_marginTop="15dp"
android:id="#+id/rezimrada"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txtTipRV"
android:layout_below="#+id/rezimrada"
android:layout_alignStart="#+id/rezimrada"
android:layout_marginStart="10dp"
android:textColor="#ffffff"
/>
<ImageView
android:layout_width="55dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:id="#+id/imgOdustani"
android:src="#drawable/odustani" />
<ImageView
android:layout_width="55dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="15dp"
android:layout_marginStart="15dp"
android:id="#+id/imgSacuvaj"
android:src="#drawable/snimi"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txtKoristiMT"
android:layout_below="#+id/txtTipRV"
android:layout_alignStart="#+id/txtTipRV"
android:textColor="#ffffff"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txtGPS"
android:layout_below="#+id/txtKoristiMT"
android:layout_alignStart="#+id/txtKoristiMT"
android:textColor="#ffffff"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txtSlika"
android:layout_below="#+id/txtGPS"
android:layout_alignStart="#+id/txtGPS"
android:textColor="#ffffff"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/txtDozTestaturu"
android:layout_below="#+id/txtSlika"
android:layout_alignStart="#+id/txtSlika"
android:textColor="#ffffff"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/layoutDesni"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9">
<ImageView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:id="#+id/imgDolazak"
android:src="#drawable/dolazak"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgOdlazak"
android:src="#drawable/odlazak"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.6">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgPauza"
android:src="#drawable/pauza"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgTeren"
android:src="#drawable/rad_teren"/>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:id="#+id/imgPrivatno"
android:src="#drawable/privatno"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Pauza"
android:textColor="#ffffff"
android:textSize="10sp"
android:src="#drawable/pauza"
android:gravity="center"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/rad_teren"
android:text="Rad na terenu"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/privatno"
android:text="Privatno odsutan"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.17">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="70dp"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:id="#+id/imgView"
android:layout_marginStart="5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginStart="1dp">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#a6bbce"
android:text="Poslednji prijavljeni"
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/txtPoslenjiUpisani"
android:textColor="#ffffff"
android:text=""
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#a6bbce"
android:text="Pozicija"
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="#+id/txtPoslednjeMestoTroska"
android:textColor="#ffffff"
android:text=""
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#a6bbce"
android:text="Vreme"
android:textSize="12sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#ffffff"
android:id="#+id/txtPoslenjeVreme"
android:text=""
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
<TextureView
android:layout_width="0.1dp"
android:layout_height="0.1dp"
android:id="#+id/texture"
android:layout_gravity="center"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.6"
android:layout_marginTop="4dp">
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.9"
android:id="#+id/imgScrollLevo"
android:src="#drawable/levo"/>
<HorizontalScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="1dp"
android:layout_weight="5"
android:id="#+id/horScrollView"
android:gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:id="#+id/layoutZaposleni"
android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.9"
android:id="#+id/imgScrollDesno"
android:src="#drawable/desno"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
And yes, I am aware that nested weights can be an issue, but this is still a test build. All the drawables exist and work.
i want to have UI like this .
I managed to do something to achieve this but i am not satisfied . I have pasted the image shows output of my code .
Please help me by improving my code or giving suggestions .
Mycode.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:id="#+id/layout1"
tools:context="com.example.shipra.testing.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal"
android:background="#dddddd"
android:id="#+id/layout2"
android:weightSum="1">
<LinearLayout
android:layout_width="50dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.3"
android:weightSum="0.3">
<TextView
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="POST ID:"
android:layout_gravity="center"
android:textSize="10sp"
android:layout_marginStart="5dp"
android:layout_weight="0.1"
android:textColor="#ababae"/>
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:text="NEW12"
android:textSize="10sp"
android:id="#+id/postId_textview"
android:textStyle="bold"
android:layout_weight="0.2"
android:layout_gravity="center"
android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:text="Pick Date:"
android:layout_gravity="center"
android:gravity="center_vertical"
android:layout_marginStart="2dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:textColor="#ababae"/>
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:text="16 Jan 2016"
android:textStyle="bold"
android:textSize="10sp"
android:layout_weight="0.1"
android:id="#+id/pickDate_textview"
android:layout_gravity="center"
android:gravity="center_vertical"/>
</LinearLayout>
<android.support.v7.widget.AppCompatTextView
android:layout_width="50dp"
android:layout_height="20dp"
android:layout_weight="0.3"
android:textSize="10sp"
android:layout_gravity="center_vertical"
android:text="2 TRAILER of 22 tons"/>
<ImageView
android:layout_width="10dp"
android:layout_height="20dp"
android:id="#+id/view1"
android:layout_gravity="center_vertical"
android:background="#android:drawable/ic_menu_close_clear_cancel"
android:layout_weight="0.2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#+id/layout2"
android:id="#+id/layout5"
android:orientation="horizontal"
android:weightSum="1.4">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="2dp"
android:background="#dddddd"
android:layout_weight="0.1"/>
<LinearLayout
android:layout_width="70dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/layout3"
android:layout_marginTop="10dp"
android:layout_weight="0.2"
android:weightSum="0.2"
android:layout_marginStart="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="10dp"
android:text="Vehicle Number"
android:textColor="#3f464d"
android:textSize="10sp"
android:layout_weight="0.1"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:layout_weight="0.1"
android:id="#+id/vehiclenumber_textview"
android:text="Vehicle number"/>
</LinearLayout>
<View
android:layout_width="7dp"
android:layout_height="match_parent"
android:id="#+id/view2"
android:layout_weight="0.1"
android:background="#dddddd"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/layout4"
android:gravity="center_horizontal"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="50dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:text="Prefered Route"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textStyle="bold"
android:textSize="10sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:text="Route"
android:textSize="10sp"
android:id="#+id/route_textview"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="63dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_marginStart="2dp"
android:weightSum="0.2">
<TextView
android:layout_width="70dp"
android:layout_height="0dp"
android:text="Lowest Market Vehicle Rate"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:text="#string/text"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_marginStart="2dp"
android:weightSum="0.2">
<TextView
android:layout_width="70dp"
android:layout_height="0dp"
android:text="Highest Market Load Rate"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:layout_marginStart="2dp"
android:text="No load offer"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="45dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="50dp"
android:layout_height="30dp"
android:text="Your Rate Per Ton"
android:layout_weight="0.1"
android:layout_marginStart="5dp"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<EditText
android:layout_width="match_parent"
android:layout_height="30dp"
android:hint="#string/Rs"
android:id="#+id/ruppee_textview"
android:textSize="10sp"/>
</LinearLayout>
<Button
android:layout_width="40dp"
android:layout_height="30dp"
android:layout_weight="0.2"
android:text="update"
android:textSize="8sp"
android:layout_marginTop="20dp"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="100dp"
android:layout_weight="0.1"
android:layout_toRightOf="#id/layout4"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="#+id/layout5"
android:background="#dddddd"/>
</RelativeLayout>
With the above code i am getting output :
Try like this
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/horizontalScrollView"
xmlns:android="http://schemas.android.com/apk/res/android" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:id="#+id/layout1"
tools:context="com.example.shipra.testing.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal"
android:background="#dddddd"
android:id="#+id/layout2"
android:weightSum="1">
<LinearLayout
android:layout_width="50dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.3"
android:weightSum="0.3">
<TextView
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="POST ID:"
android:layout_gravity="center"
android:textSize="10sp"
android:layout_marginStart="5dp"
android:layout_weight="0.1"
android:textColor="#ababae"/>
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:text="NEW12"
android:textSize="10sp"
android:id="#+id/postId_textview"
android:textStyle="bold"
android:layout_weight="0.2"
android:layout_gravity="center"
android:gravity="center_vertical" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:text="Pick Date:"
android:layout_gravity="center"
android:gravity="center_vertical"
android:layout_marginStart="2dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:textColor="#ababae"/>
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:text="16 Jan 2016"
android:textStyle="bold"
android:textSize="10sp"
android:layout_weight="0.1"
android:id="#+id/pickDate_textview"
android:layout_gravity="center"
android:gravity="center_vertical"/>
</LinearLayout>
<android.support.v7.widget.AppCompatTextView
android:layout_width="50dp"
android:layout_height="20dp"
android:layout_weight="0.3"
android:textSize="10sp"
android:layout_gravity="center_vertical"
android:text="2 TRAILER of 22 tons"/>
<ImageView
android:layout_width="10dp"
android:layout_height="20dp"
android:id="#+id/view1"
android:layout_gravity="center_vertical"
android:background="#android:drawable/ic_menu_close_clear_cancel"
android:layout_weight="0.2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="#+id/layout2"
android:id="#+id/layout5"
android:orientation="horizontal"
android:weightSum="1.4">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="2dp"
android:background="#dddddd"
android:layout_weight="0.1"/>
<LinearLayout
android:layout_width="70dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="#+id/layout3"
android:layout_marginTop="10dp"
android:layout_weight="0.2"
android:weightSum="0.2"
android:layout_marginStart="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="10dp"
android:text="Vehicle Number"
android:textColor="#3f464d"
android:textSize="10sp"
android:layout_weight="0.1"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
android:layout_weight="0.1"
android:id="#+id/vehiclenumber_textview"
android:text="Vehicle number"/>
</LinearLayout>
<View
android:layout_width="7dp"
android:layout_height="match_parent"
android:id="#+id/view2"
android:layout_weight="0.1"
android:background="#dddddd"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/layout4"
android:gravity="center_horizontal"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="50dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:text="Prefered Route"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textStyle="bold"
android:textSize="10sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:text="Route"
android:textSize="10sp"
android:id="#+id/route_textview"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="63dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_marginStart="2dp"
android:weightSum="0.2">
<TextView
android:layout_width="70dp"
android:layout_height="0dp"
android:text="Lowest Market Vehicle Rate"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:text="#string/text"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:layout_marginStart="2dp"
android:weightSum="0.2">
<TextView
android:layout_width="70dp"
android:layout_height="0dp"
android:text="Highest Market Load Rate"
android:layout_weight="0.1"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.1"
android:textSize="10sp"
android:layout_marginStart="2dp"
android:text="No load offer"
android:textColor="#3f464d"/>
</LinearLayout>
<LinearLayout
android:layout_width="45dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="0.2"
android:weightSum="0.2">
<TextView
android:layout_width="50dp"
android:layout_height="30dp"
android:text="Your Rate Per Ton"
android:layout_weight="0.1"
android:layout_marginStart="5dp"
android:textColor="#3f464d"
android:textSize="10sp"
android:textStyle="bold"/>
<EditText
android:layout_width="match_parent"
android:layout_height="30dp"
android:hint="#string/Rs"
android:id="#+id/ruppee_textview"
android:textSize="10sp"/>
</LinearLayout>
<Button
android:layout_width="40dp"
android:layout_height="30dp"
android:layout_weight="0.2"
android:text="update"
android:textSize="8sp"
android:layout_marginTop="20dp"/>
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="100dp"
android:layout_weight="0.1"
android:layout_toRightOf="#id/layout4"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_below="#+id/layout5"
android:background="#dddddd"/>
</RelativeLayout>
</HorizontalScrollView>
Instead of Relativelayout you can define TableLayout and you can replace LinearLayout with TableRow
How To manage imageviews and textview with theirs alignments ?
here is code i have tried.. i have used toolbar to achieve this but failed to achieve , can anyone tell me how to accomplish this ?
<android.support.v7.widget.Toolbar
android:background="#color/backcolor"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="8">
<TextView
android:layout_weight="2"
android:drawableTop="#drawable/a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Grid"
android:textSize="15sp"
android:textColor="#color/white"
android:textStyle="bold"
/>
<ImageView
android:layout_weight="2"
android:adjustViewBounds="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/a"
android:layout_gravity="center" />
<ImageView
android:layout_weight="2"
android:adjustViewBounds="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/a"
android:layout_gravity="center" />
<ImageView
android:layout_weight="2"
android:adjustViewBounds="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/a"
android:layout_gravity="center" />
<ImageView
android:layout_weight="2"
android:adjustViewBounds="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/a"
android:layout_gravity="center" />
<ImageView
android:layout_weight="2"
android:adjustViewBounds="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/a"
android:layout_gravity="center" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
out put i want
Try this code.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?attr/fillColor"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/ic_launcher"
android:gravity="center"
android:text="Test"
android:textColor="?attr/fillColor"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="1dip"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:background="#000000" />
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="?attr/fillColor" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/ic_launcher"
android:gravity="center"
android:text="Test"
android:textColor="?attr/fillColor"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="1dip"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:background="#000000" />
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="?attr/fillColor" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/ic_launcher"
android:gravity="center"
android:text="Test"
android:textColor="?attr/fillColor"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="1dip"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:background="#000000" />
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="?attr/fillColor" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="2"
android:drawableTop="#drawable/ic_launcher"
android:gravity="center"
android:text="Test"
android:textColor="?attr/fillColor"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
Here is Screen Shot.
Try following layout:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#color/com_facebook_button_background_color"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/a"
android:gravity="center"
android:text="Grid"
android:textColor="#color/colorWhite"
android:textSize="15sp"
android:textStyle="bold"
/>
</LinearLayout>
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="#color/colorWhite"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/a"
android:gravity="center"
android:text="Grid"
android:textColor="#color/colorWhite"
android:textSize="15sp"
android:textStyle="bold"
/>
</LinearLayout>
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="#color/colorWhite"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="#drawable/a"
android:gravity="center"
android:text="Grid"
android:textColor="#color/colorWhite"
android:textSize="15sp"
android:textStyle="bold"
/>
</LinearLayout>
<ImageView
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="#color/colorWhite"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="2"
android:drawableTop="#drawable/a"
android:gravity="center"
android:text="Grid"
android:textColor="#color/colorWhite"
android:textSize="15sp"
android:textStyle="bold"
/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
Try this way it works for me
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:Fnt_Awsm_Button="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/fbutton_color_whight"
android:orientation="vertical"
android:padding="#dimen/marging_pading_8pd">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="4"
android:background="#f0ff"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/batss"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:text="Grid"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="50dp"
android:background="#ff00ff"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/batss"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:text="Grid"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="50dp"
android:background="#ff00ff"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/batss"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:text="Grid"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="50dp"
android:background="#ff00ff"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/batss"
android:layout_gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:text="Grid"
android:layout_gravity="center_horizontal"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
use 4 textview only
[<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/actvity1_padda" >
<TextView
android:id="#+id/main_comp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="#drawable/chat_secton8"
android:text="#string/comp" />
<TextView
android:id="#+id/main_learn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="#drawable/lean_businesstip"
android:text="#string/learn" />
<TextView
android:id="#+id/main_mydoc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="#drawable/chat_increase"
android:text="#string/mydoc" />
<TextView
android:id="#+id/main_business"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableTop="#drawable/chat_secton8"
android:text="Business" />
</LinearLayout>][1]
I'm trying to utilize elevation attributes to display drop shadows. As you can see from the images, it displays fine in Android Studio but when run on the device, one of the drop shadows disappears. Why would one show but not the other?
Image from Android Studio
Screenshot from Marshmallow device
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white_80"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/booking_details_top_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:elevation="4dp"
>
<LinearLayout
android:id="#+id/image_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="8dp"
android:background="#color/black"
/>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="8dp"
android:background="#color/black"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_margin="16dp"
android:padding="16dp"
android:background="#drawable/booking_detail_date_background"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
tools:text ="Tuesday, September 1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
tools:text ="4:00 PM - 6:00 PM"
/>
</LinearLayout>
<TextView
android:id="#+id/bookings_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingRight="16dp"
android:paddingLeft="16dp"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
android:background="#drawable/status_background"
android:textColor="#color/white"
tools:text="CONFIRMED"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_marginTop="8dp"
android:padding="8dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text ="#string/booking_details_brig"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
tools:text ="Lorena M."
/>
</LinearLayout>
<RatingBar
android:id="#+id/rate_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stepSize="1"
style="#style/Widget.CustomRatingBar"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:layout_marginBottom="24dp"
android:layout_marginRight="#dimen/dialog_horizontal_margin"
android:layout_marginLeft="#dimen/dialog_horizontal_margin"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
/>
</LinearLayout>
<include layout="#layout/widget_booking_details" />
</LinearLayout>
widget_booking_details
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:elevation="2dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_address"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="22 Phitsanulok Rd, apt. 3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Khwaeng Dusit, Dusit"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/white"
android:layout_marginStart="#dimen/booking_details_margin"
android:layout_marginEnd="#dimen/booking_details_margin"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_services"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center_vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Waves after waves,"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Evening glam"/>
</LinearLayout>
</LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/booking_details_margin"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="#drawable/up_arrow"
android:background="#color/cream"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/white"
android:layout_marginStart="#dimen/booking_details_margin"
android:layout_marginEnd="#dimen/booking_details_margin"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_cost"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
tools:text="24,600B"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/white"
android:layout_marginStart="#dimen/booking_details_margin"
android:layout_marginEnd="#dimen/booking_details_margin"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_payment"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
tools:text="Mastercard ending 1234"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/white"
android:layout_marginStart="#dimen/booking_details_margin"
android:layout_marginEnd="#dimen/booking_details_margin"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_booking_ref"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
tools:text="1639460503"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="#dimen/booking_details_padding"
android:paddingBottom="#dimen/booking_details_padding"
android:background="#color/white"
>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="#dimen/booking_details_margin"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_booking_help"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:text="#string/booking_details_booking_help_email"/>
<!--TODO make email an actual link-->
</LinearLayout>
Odd solution but I merely had to put a background color in:
<LinearLayout
android:id="#+id/booking_details_top_block"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/white"
android:elevation="4dp"
>