Questions tagged [android-elevation]

Android elevation is a feature introduced in Android Lollipop 5.0, is part of new Google Material Design Recommendation. Also involves translationZ property.

Android elevation is a feature introduced in Android Lollipop 5.0, is part of new Google Material Design Recommendation. Also involves translationZ feature.

Material design introduces elevation for UI elements. Elevation helps users understand the relative importance of each element and focus their attention to the task at hand.

Assign Elevation to Your Views

206 questions
4
votes
2 answers

how to fix shadow problem with elevation in react-native for android

I'm trying to show shadow around a view in react-native. I tried this
Asmat ullah
  • 681
  • 8
  • 23
4
votes
1 answer

Android elevation - same values different shadow

I encountered a strange error while setting elevations to items in recycler-view. I have two item types in adapter, first is a kind of dashboard with complex layout with three cardviews. Second one is classic item for data list where each item has…
4
votes
0 answers

CollapsingToolbarLayout elevation not showing

I have a programmatically added collapsingToolbarLayout. For some reason, I do not see the elevation, either in its collapsed or expanded state. I've tried the following to no avail: Resources r = getResources(); AppBarLayout appBarLayout =…
4
votes
1 answer

How to have a FAB with option of no padding, yet still have it elevation?

background I have a small circular contact photo view that I need to show the user. If the photo is available, I should show it, while the image gets rounded to a circle, and has an elevation. If the photo isn't available, I show an icon inside with…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
4
votes
0 answers

CardView in NestedScrollView increases elevation automatically [Image included]

I'm adding cards in a nested scrollview. The card elevation automatically increases for the cards that are lower down the order in the LinearLayout. To understand the issue, notice the card elevation between first and last cards. The last card has a…
4
votes
1 answer

Applying shadow with android elevation

i'm trying to apply shadow on my layout using android:elevation, but it doesn't work for Android pre lolipop, is there any alternative of it. thanks in Advance.
Sfayn
  • 190
  • 1
  • 2
  • 13
4
votes
2 answers

Elevation property not working android

Hi I am developing android application in which I am trying to implement new material design features. I tried to apply elevation property but it is not working for me. I tried it in following way.
nilkash
  • 7,408
  • 32
  • 99
  • 176
3
votes
1 answer

android:elevation is not working on an imageView of a vector drawable

I have a simple ImageView of a trashcan which I imported as a vector asset. This is the XML
bcsta
  • 1,963
  • 3
  • 22
  • 61
3
votes
1 answer

Recycler view item decoration and view elevation

I use recycler view decoration to add margin before specific items. My items - mostly MaterialCardView - have an important elevation : 16dp (thanks to our UI guys...) Elevations are allowed to be drawn outside item view container with…
3
votes
1 answer

React Native elevation StyleSheet not working in FlatList

I'm trying to style my renderItem in FlatList but elevation not working properly. Is there anything I'm wrong or this is a React Native issue? I tested ListView too but it still not working properly This is TodoItem component import React, {…
3
votes
2 answers

Android: How to create exact material design shadow with XML drawable

I would like to make an XMl drawable file that resembles as closely as possible to the material design elevation found on Lollipop and above. I currently have a shadow that does not even come close as I have no idea what gradient I'm suppose to…
3
votes
2 answers

Android : Elevation for toggle button with custom Background

I want to use custom toggle buttons. Currently I use the following xml file to define a "custom" background:
Chuchaki
  • 361
  • 1
  • 3
  • 14
3
votes
0 answers

How to get Android's default dimension constants

Is it possible to get a reference to the xml defined dimensions that Android itself uses? I'm using material design and noticed that a Button has a default elevation > 0. I want some of my custom elements to sit above the button (in the z dimension)…
neonDion
  • 2,278
  • 2
  • 20
  • 39
3
votes
1 answer

What is resting elevation in android?

I am little bit confused with the term "resting elevation." I know what is elevation in android material design environment but couldn't exactly know what is resting elevation. Is it the zero elevation of a material (i.e.) it is not having any…
Senthilkumar S
  • 171
  • 3
  • 16
3
votes
3 answers

Android elevation not showing shadows

I want to create a login screen by putting a linear layout that holds logging elements in the middle of the screen with some shadows.Despite I set elevation and padding for this linear layout I still dont get any shadows, Could somebody have a look?…
in4001
  • 656
  • 6
  • 24