Answer the question
In order to leave comments, you need to log in
Why is android:elevation not working?
I am developing a calculator for Android, and when creating markup for round clocks, I ran into a problem, when specifying android:elevation - it does not draw a shadow. Where is the mistake?
Development environment -
Emulator -
XML markup -
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:deviceIds="wear_round"
android:id="@+id/round_activity_main"
style="@style/AppTheme"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:id="@+id/frameLayout"
android:elevation="10sp"
android:layout_alignParentEnd="true">
<TextView
android:layout_width="fill_parent"
android:layout_height="40sp"
android:gravity="center"
android:maxLines="2"
android:id="@+id/tvResult"
android:textStyle="bold"
android:text=""
android:fontFamily="sans-serif-light"
style="@style/AppTheme"
android:layout_marginLeft="40sp"
android:layout_marginRight="40sp"
android:layout_marginTop="20dp" />
</FrameLayout>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pagerRound"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/AppTheme"
android:layout_below="@+id/frameLayout" />
</RelativeLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question