Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is elevation doing in Android L?

Today I developed my first Android L Apps, and read through the d.android.com/preview tips. They said that android:elevation would show me shadows. But look at this:

<TextView
    android:id="@+id/tvTest5"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_below="@id/btnTest1"
    android:layout_toRightOf="@id/tvTest4"
    android:layout_marginLeft="10dp"
    android:background="#000000"
    android:elevation="50dp"/>

I don't see any shadow in my Emulator. Am I doing something wrong or is the Emulator buggy? I'm using Android Studio

like image 934
humbug Avatar asked Jul 03 '14 15:07

humbug


People also ask

What does android elevation do?

Elevation helps users understand the relative importance of each element and focus their attention to the task at hand. The elevation of a view, represented by the Z property, determines the visual appearance of its shadow: views with higher Z values cast larger, softer shadows.

What is elevation in XML?

Elevation (Android) Elevation is the relative depth, or distance, between two surfaces along the z-axis. Specifications: Elevation is measured in the same units as the x and y axes, typically in density-independent pixels (dp).

How to set elevation color in android?

Lollipop's elevation system doesn't support colored shadows. But, if you need colored shadows, it's possible to get them using Carbon. It's a kind-of support library for Material Design and in the most recent version there is an option to change shadow color.


1 Answers

I kinda solved it. The problem was the emulator. We now have ordered a Nexus 5 and flashed Android L. Now it works fine

like image 76
humbug Avatar answered Oct 11 '22 05:10

humbug