Niklas Siefke
Niklas Siefke

Reputation: 343

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

Upvotes: 8

Views: 5364

Answers (3)

Niklas Siefke
Niklas Siefke

Reputation: 343

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

Upvotes: 1

android developer
android developer

Reputation: 116030

You should watch the video talking about it:

Google I/O 2014 - Material science: Developing Android applications with material

They said there that elevation has weird issues if the Z value isn't different between views.

It starts at about 15:00 .

Upvotes: 0

Amitabh
Amitabh

Reputation: 172

You should see the elevation when you create two views with different z-index.

Upvotes: 0

Related Questions