Android elevation shadows not showing at runtime -
i'm trying utilize elevation attributes display drop shadows. can see images, displays fine in android studio when run on device, 1 of drop shadows disappears. why 1 show not other?
image android studio
<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 actual link--> </linearlayout>
odd solution merely had put 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" >
Comments
Post a Comment