android-elevation

How can I show the shadow only on the bottom side of the tablayout?

你。 提交于 2019-12-25 01:44:12
问题 I have this layout : <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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="#ffffff" android:clickable="true" android:focusable="true"> <android.support.constraint.ConstraintLayout android:id="@+id/details" android:layout_width="500dp" android:layout_height="wrap

How can I show the shadow only on the bottom side of the tablayout?

时间秒杀一切 提交于 2019-12-25 01:29:21
问题 I have this layout : <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout 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="#ffffff" android:clickable="true" android:focusable="true"> <android.support.constraint.ConstraintLayout android:id="@+id/details" android:layout_width="500dp" android:layout_height="wrap

How to bring imageView in front of cardview ? When both are of Relative Layout childs

こ雲淡風輕ζ 提交于 2019-12-21 07:25:12
问题 I have a layout 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:id="@+id/containor" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#fff6da" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android

Changing CardView shadow color

心已入冬 提交于 2019-12-18 10:35:23
问题 This question was asked on SO many times, but still I didn't find a good solution for this problem. Why do I need this to do? Well because project me and my team develops has iOS style. What did I try? 9.pathch shadow generator but 9.pathes are essentially pngs and it gives me no flexibility and if I'll use this approach I should edit margins everywhere. Carbon library it supports custom shadows and they get drawn outside of view borders, but there is issue regarding rounded rectangles, when

How to implement the Material-design Elevation for Pre-lollipop

折月煮酒 提交于 2019-12-17 04:46:08
问题 Google has shown some nice ways that elevation effect are shown on Lollipop here. android:elevation="2dp" for buttons, android:stateListAnimator="@anim/button_state_list_animator" How can I mimic the elevation effect on pre-Lollipop versions without 3rd party library? 回答1: You can mimic the elevation on pre-Lollipop with a official method. I achieve same effect using, android:background="@android:drawable/dialog_holo_light_frame" My tested output: reference - https://stackoverflow.com/a

Toolbar not showing elevation in Android 9, API 28

℡╲_俬逩灬. 提交于 2019-12-13 05:06:01
问题 In my app, the Toolbar is not showing shadow at its bottom, my target API is from Android 6 M to Android 9 P , I am testing my app on device having Android 9 Pie . There is a same question here but no answer. toolbar.xml <androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:elevation="4dp"> </androidx.appcompat.widget.Toolbar> activity_main

Change Elevation of ActionBar by theme

烈酒焚心 提交于 2019-12-09 05:10:57
问题 I want to remove the shadow below the ActionBar. I know that I need to change the elevation to 0dp, but I want to do it in the theme. For Android 4.4- I use : <item name="android:windowContentOverlay">@null</item> But is it possible for Android 5.0 ? 回答1: As shown by Antonio Jose, here is an answer : Remove shadow below actionbar For Android 5.0, if you want to set it directly into a style use: <item name="android:elevation">0dp</item> and for Support library compatibility use: <item name=

Elevation not working for ImageView

我的梦境 提交于 2019-12-09 05:04:16
问题 Elevation for ImageView is not working. I declared ImageView in XML like this: <ImageView android:id="@+id/image" android:layout_width="100dp" android:layout_height="50dp" android:elevation="10dp" android:src="@drawable/youtube" /> What else should I do for elevation to work properly for ImageView? 回答1: The elevation shadow is derived from the background drawable of a View. If your ImageView has no background, you'll see no shadow. If you want to change that behavior, you need to build your

Progress bar shadow only on filled part

蓝咒 提交于 2019-12-08 05:18:52
问题 Implementing a progress bar in android, trying to get a drop shadow on the bottom part of the filled section only, like this: API level is KitKat and up but i wont mind a solution that applies to LOLLIPOP and up only. Elevation does not seem to work, nor do the card View. any sugesstions? 回答1: Create the following xml shape and place it as your progressBar background. ** The 10dp in the xml assumes the progressBar is 20dp in Height and that you want the shadow to be exactly half of it. <?xml

Elevated RecyclerView items get progressively deformed (elevation changes)

老子叫甜甜 提交于 2019-12-07 01:54:18
问题 Any idea why RecyclerView items get deformed , each consecutive item gets worse? UPDATE: I'm using CardViews and now there's no view "deformation" but the shadow/elevation height changes. It seems that elevation gets higher depending on where on the screen the item is located vertically, the shadow grows as the item gets scrolled down. Please see the video here: https://youtu.be/nROYq8rpUMs. I've set up a new project leaving only the code necessary to demonstrate the issue: MainActivity.java