Android第三方开源FloatingActionButton(com.getbase.floatingactionbutton)【2】
2015-12-03 22:00
495 查看
Android第三方开源FloatingActionButton(com.getbase.floatingactionbutton)【2】
通常FloatingActionButton多用于在屏幕的左、右下角接受添加动作,有感于此com.getbase.floatingactionbutton的作者干脆把这类按钮抽象成一个AddFloatingActionButton。比如,写一个布局实现:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="zhangphil.fab.MainActivity" >
<com.getbase.floatingactionbutton.AddFloatingActionButton
android:id="@+id/normal_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
fab:fab_colorNormal="@color/white"
fab:fab_colorPressed="@color/white_pressed"
fab:fab_plusIconColor="@color/half_black" />
</RelativeLayout>
代码运行结果(左下角即为AddFloatingActionButton):
附录参考文章:
【文章1】《Android第三方开源FloatingActionButton(com.getbase.floatingactionbutton)【1】》链接地址:http://blog.csdn.net/zhangphil/article/details/50166715
【文章2】《Android Material Design的FloatingActionButton,Snackbar和CoordinatorLayout》链接地址:http://blog.csdn.net/zhangphil/article/details/48861371
【文章3】《Android第三方FloatingActionButton:伴随ListView、RecyclerView、ScrollView滚动滑入滑出》链接地址:http://blog.csdn.net/zhangphil/article/details/50135707
通常FloatingActionButton多用于在屏幕的左、右下角接受添加动作,有感于此com.getbase.floatingactionbutton的作者干脆把这类按钮抽象成一个AddFloatingActionButton。比如,写一个布局实现:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="zhangphil.fab.MainActivity" >
<com.getbase.floatingactionbutton.AddFloatingActionButton
android:id="@+id/normal_plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
fab:fab_colorNormal="@color/white"
fab:fab_colorPressed="@color/white_pressed"
fab:fab_plusIconColor="@color/half_black" />
</RelativeLayout>
代码运行结果(左下角即为AddFloatingActionButton):
附录参考文章:
【文章1】《Android第三方开源FloatingActionButton(com.getbase.floatingactionbutton)【1】》链接地址:http://blog.csdn.net/zhangphil/article/details/50166715
【文章2】《Android Material Design的FloatingActionButton,Snackbar和CoordinatorLayout》链接地址:http://blog.csdn.net/zhangphil/article/details/48861371
【文章3】《Android第三方FloatingActionButton:伴随ListView、RecyclerView、ScrollView滚动滑入滑出》链接地址:http://blog.csdn.net/zhangphil/article/details/50135707
相关文章推荐
- android 点击时背景图片 、 文字颜色变换
- Android基础之Activity系列 - Activity间的数据传递
- Android SDK 在线更新镜像服务器资源
- Android集成支付宝
- Android之mvp和mvc对比分析以及实际应用
- Android第三方开源FloatingActionButton(com.getbase.floatingactionbutton)【1】
- Android设置特定时间执行操作
- Android SurfaceView简介
- 短信发送器
- Android电话拨号器
- Intent的简介以及属性的详解
- Android SharedPreferences安全存储/AutoCompleteTextView使用/文件读写
- Activity的生命周期
- Android 手势控制解锁,滑动图片,照相,音乐切换,收音机换台,短信界面打电话
- Android作业分组与选题
- 用Intent调用系统中经常被用到的组件
- Android是否联网判断
- 设置ExpandableListView不显示分割线
- float/double数据不显示成科学计数法
- Android关于ListView的分割线问题