<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <FrameLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="16dp" android:background="#fff" android:elevation="4dp" /> <FrameLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="16dp" android:background="#fff" android:elevation="8dp" /> <FrameLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="16dp" android:background="#fff" android:elevation="16dp" /> </LinearLayout>
f-a-b => FAB
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:design:22.2.0' }
activity_main.xml
<android.support.design.widget.FloatingActionButton app:fabSize="normal" app:elevation="6dp" app:layout_gravity="end" app:pressedTranslationZ="12dp" android:id="@+id/fab" android:src="@drawable/fab_plus" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_margin="16dp" />
styles.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:Theme.Material.Light"> </style> </resources> <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="Theme.AppCompat.Light"> </style> </resources>