华拓科技网
您的当前位置:首页Android 5.0新控件——FloatingActionButton(悬浮按钮)

Android 5.0新控件——FloatingActionButton(悬浮按钮)

来源:华拓科技网

Android 5.0新控件——FloatingActionButton(悬浮按钮)

效果图

使用

使用方法和Button一样
有的文章说FloatingActionButton在5.x版本上有Bug,没有阴影效果,我个人理解是因为SDK版本不同,对应效果也有所不同,而不是Bug,如果非想要5.x的系统显示4.x效果,可以看下相关的文章。

导入SDK

用前先导入依赖

compile 'com.android.support:design:23.1.1'

布局

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@android:drawable/ic_dialog_email" />

转载于:https://www.cnblogs.com/sesexxoo/p/6190473.html

因篇幅问题不能全部显示,请点此查看更多更全内容