0

I am trying to use the android:elevation attribute but it has no effect on the views. What I am doing wrong? Here is the xml code with one FrameLayout and one Button but none of them is showing any shadow.

<?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:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.vaibhav.uielements.MainActivity">

    <FrameLayout
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_centerVertical="true"
        android:elevation="15dp"
        android:background="@android:color/white"
        android:layout_centerHorizontal="true" />

    <Button
        android:text="Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:elevation="10dp"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="45dp"
        android:id="@+id/button" />

</RelativeLayout>

[This is the preview[1]

0 Answers0