悬浮按钮
继承:⇐
FloatingActionButton ⇐ VisibilityAwareImageButton ⇐ ImageButton ⇐ ImageView,所以FloatingActionButton拥有ImageView的所有属性。
使用准备
需要在gradle中进行如下配置,注意自己的版本。
compile 'com.android.support:design:25.3.1'
用法
注意XML中的“app:”部分是该组件独有的属性。
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="@color/colorPrimary"
android:layout_height="match_parent"
>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/timg"/>
android:id="@+id/fb