Material Design之FloatingActionBar
2016-05-04 11:48
507 查看
https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html
默认的背景颜色是theme的
与
隐藏FAB。
默认的背景颜色是theme的
colorAccent。如果想改变的话,可以通过
setBackgroundTintList(ColorStateList)、
app:backgroundTint="@color/colorPrimary"(
android:backgroundTint API Version 21或以上)方法实现。
app:fabSize:FloatingActionButton的大小,有两种赋值分别是 “mini” 和 “normal”,默认是“normal。
app:backgroundTint:FloatingActionButton的背景颜色,默认的背景颜色是Theme主题中的。
app:rippleColor- 设置FAB点击时的背景颜色。
app:borderWidth- 该属性尤为重要,如果不设置0dp,那么在4.1的sdk上FAB会显示为正方形,而且在5.0以后的sdk没有阴影效果。所以设置为borderWidth=”0dp”。
app:elevation- 默认状态下FAB的阴影大小。
app:pressedTranslationZ- 点击时候FAB的阴影大小。
app:fabSize- 设置FAB的大小,该属性有两个值,分别为normal和mini,对应的FAB大小分别为56dp和40dp。
src- 设置FAB的图标,Google建议符合Design设计的该图标大小为24dp。
与
CoordinatorLayout一起使用
app:layout_anchor- 设置FAB的锚点,即以哪个控件为参照点设置位置。
app:layout_anchorGravity- 设置FAB相对锚点的位置,值有 bottom、center、right、left、top等。
This method will animate the button hide if the view has already been laid out. */ public void hide() { hide(null); }" data-snippet-id="ext.71c49f4108fc6ffe901523a1a04b112c" data-snippet-saved="false" data-codota-status="done">[code] /** * Hides the button. * <p>This method will animate the button hide if the view has already been laid out.</p> */ public void hide() { hide(null); }
隐藏FAB。
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件
- SourceProvider.getJniDirectories