Google 캘린더와 같은 플로팅 작업 버튼 (목록보기에 항목을 추가하기 위해)을 만들고 사전 롤리팝 Android 버전 (5.0 이전)과의 호환성을 유지하고 싶습니다.
이 레이아웃을 만들었습니다.
활동 main_activity.xml :
<LinearLayout ... >
<include
layout="@layout/toolbar"/>
<RelativeLayout ... >
<!-- My rest of the layout -->
<!-- Floating action button -->
<ImageButton style="@style/AppTheme"
android:layout_width="60dp"
android:layout_height="60dp"
android:text="New Button"
android:id="@+id/button"
android:src="@drawable/ic_fab"
android:background="@drawable/fab"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="24dp"
android:layout_marginRight="24dp"/>
</RelativeLayout>
</LinearLayout>
드로어 블 fab.xml :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#ffa48bc0"/>
</shape>
스타일 styles.xml
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#ff1d79b1</item>
<item name="colorPrimaryDark">#ff084d95</item>
</style>
</resources>
결과는 비슷하지만 머티리얼 디자인의 특징 인 음영이 없습니다.
캘린더의 플로팅 작업 버튼 :

내 앱의 플로팅 작업 버튼 :

버튼에 음영을 추가하려면 어떻게해야합니까?
이미 속성 상승을 사용했지만 작동하지 않습니다.

