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
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.
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).
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.
I kinda solved it. The problem was the emulator. We now have ordered a Nexus 5 and flashed Android L. Now it works fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With