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
2
votes
1 answer

Setting Card Elevation makes top view on the card invisible for card area in lollipop

I am getting an issue on android lollipop. I have a FrameLayout, in that layout I have a Cardview and at the top I have a RecyclerView. like whenever I set cardElevtion everything works…
Muhammad Adil
  • 4,358
  • 3
  • 32
  • 36
2
votes
1 answer

PopupWindow elevation becomes distorted/darker when containing textview has ripple or selector and is clicked

The PopupWindow is programmatically created and its elevation is set. The shadow initially looks as expected but once a textview is clicked, whether it has ripple or selector as background the shadow changes. It looks like it animates to black or…
bluewhale
  • 181
  • 2
  • 9
2
votes
2 answers

Elevation for FAB doesn't work

I'm trying to test FAB from android.support.design.widget.FloatingActionButton When I set elevation from the xml layout, the shadow shows the elevation. When I try to change elevation programmatically: fab.setElevation(9); I get an error saying…
rommex
  • 763
  • 1
  • 8
  • 21
2
votes
2 answers

Android imageView with elevation is blocked by text view

I need some help with android layout Here is a imageView
2
votes
1 answer

Total beginner; need help properly setting up my Android 5.0 Toolbar

I do have a toolbar right now, but I don't really understand a lot of the things that I needed to add and copypaste from tutorials and other questions to get it to work. Also, my toolbar doesn't display an elevation even though I set…
1
vote
0 answers

Translating other views along with Button (on press)

I was looking to create a view like this: It has the behavior of a button, so I used a ConstraintLayout and placed the image and the TextView ('some text here') on top of the button using constraints (the other text and icon is implemented as…
1
vote
1 answer

Wrong elevation shadows during fragment transaction

I have two fragments being replaced in the container. My problem is with elevation shadows during the custom animation that I use for the transaction. I set the duration to two seconds to see it properly and it seems only shadows from ambient light…
TheJudge
  • 576
  • 1
  • 9
  • 30
1
vote
0 answers

Android Buttons are clipping each other in RelativeLayout

To make Piano like layout, I've used RelativeLayout and put buttons in such a way that black buttons would overlap white buttons as shown in screenshot below. When I click white Buttons, they overlaps Black Buttons. In HTML there is property named…
Govind_das
  • 67
  • 7
1
vote
1 answer

How to add elevation for shape?

Now i have next rectangle:
Morozov
  • 4,968
  • 6
  • 39
  • 70
1
vote
0 answers

Android shadow not work if use alignParentTop

I use this code and shadow work fine:
1
vote
2 answers

Why Card elevation is ignored in layout_height="wrap_content"?

I am creating an app and re-building a control in Xamarin.Android. The control works as expected, but I noticed if I choose android:layout_height="wrap_content" the Elevation is gone: But if I choose the android:layout_height="match_parent" it…
1
vote
0 answers

Android bottomRightRadius + elevation results in gray bar

I'm running into some really strange behaviour when running this (test) layout on my OnePlus6T but it works fine when i run it in the emulator. There is a gray bar appearing below the FrameLayout which increases/decreases in size depending on the…
Myth1c
  • 639
  • 1
  • 7
  • 23
1
vote
0 answers

Setting the global elevation (z-axis) to a View

Is there any way to set a View's elevation globally regardless of its parent ViewGroup, i.e. relative to the activity's root view? If it can be done with some native code that would be ok too. I have a custom View that needs to show a badge within…
P Fuster
  • 2,224
  • 1
  • 20
  • 30
1
vote
5 answers

Shadow effect in Recyclerview items

I want to achieve a design with a linear layout and few widgets along with shadow effect such as elevation, but I'm unable to get the shadows right. I tried to adding elevation no to the linear layout, but it doesn't show any effect in the design. I…
1
vote
1 answer

Cardview shadow looks different when inside a ScrollView

I stumbled upon something weird. I am using the same CardView component in more than one place in my app, all with the same elevation (3dp), and they all looks the same. However, for one scenario I need to embed the CardView inside a ScrollView. I…
GVillani82
  • 17,196
  • 30
  • 105
  • 172