Material Design(八)--CoordinatorLayout和FloatingActionButton

两者使用的一个好例子是当你添加一个FloatingActionButton作为CoordinatorLayout的子元素,然后再将这个CoordinatorLayout传递给Snackbar.make()调用—这样的话,不是snackbar展示在FloatingActionButton的上面,而是在snackbar以动画的形式进入屏幕的进修FloatingActionButton充分利用了CoordinatorLayout提供的回调自动向上移动,然后在snackbar返回它的位置的时候,snackbar在Android 3.0以上的设备上产生动画退出屏幕,而不需要额外的代码。

CoordinatorLayout也提供了layout_anchor属性,该属性和layout_anchorGravity一起能够用于放置浮动视图,例如FloatingActionButton,并关联到其它视图。

时间: 2024-08-28 11:11:58

Material Design(八)--CoordinatorLayout和FloatingActionButton的相关文章

Material Design(五)--FloatingActionButton

漂浮动作按钮是一个在交互界面上提供基本动作的圆形按钮.Design包中的FloatingActionButton向你提供了单个一致的实现,默认情况下是涂上了主题中的colorAccent颜色. 漂流动作按钮除了有正常尺寸外,它还在拥有其它元素时可视化持续性非常挑剔的时候支持迷你尺寸(fabSize=”mini”).因为FloatingActionButton扩展自ImageView,所有的你也可以使用android:src,或者其它任何诸如setImageDrawable()的方法来控制显示在F

Android(Lollipop/5.0) Material Design(四) 创建列表和卡片

Material Design系列 Android(Lollipop/5.0)Material Design(一) 简单介绍 Android(Lollipop/5.0)Material Design(二) 入门指南 Android(Lollipop/5.0)Material Design(三) 使用Material主题 Android(Lollipop/5.0)Material Design(四) 创建列表和卡片 Android(Lollipop/5.0)Material Design(五) 定

Material Design之FloatingActionButton的使用

FloatingActionButton是继承至ImageView,所以FloatingActionButton拥有ImageView的所有属性.CoordinatorLayout可以用来配合FloatingActionButton浮动按钮,设置app:layout_anchor和app:layout_anchorGravity构建出特定的位置与效果的FloatingActionButton. 我们来看看怎么使用FloatingActionButton吧: <android.support.de

Material Design(九)--CoordinatorLayout和App Bar

CoordinatorLayout的其它主要使用实例包括app bar(即先前的action bar)和滚动技术.你也许已经在布局中使用Toolbar了,Toolbar允许你轻易地自定义外观和应用中图标部分与布局的集成.Design包在这一点走得更远:使用AppBarLayout允许Toolbar和其它的视图(如TabLayout提供了tab)对标记了ScrollingViewBehavior的兄弟视图中的滚动事件产生反馈.由此,你可以像这样创建布局: 1 <android.support.de

Material Design 开发利器:Android Design Support Library 介绍

转自:https://blog.leancloud.cn/3306/ Android 5.0 Lollipop 是迄今为止最重大的一次发布,很大程度上是因为 material design —— 这是一门新的设计语言,它刷新了整个 Android 的用户体验.但是对于开发者来说,要设计出完全符合 material design 哲学的应用,是一个很大的挑战.Android Design Support Library 对此提供了很好的支持,里面汇集了很多重要的 material design 控

Android控件使用 — 12个Material Design风格控件的使用

项目在GitHub上的地址: https://github.com/Hebin320/MaterialDesignUse 1.AppBarLayout.ToolBar AppBarLayout 是继承LinerLayout实现的一个ViewGroup容器组件,它是为了Material Design设计的App Bar,支持手势滑动操作. AppBarLayout必须作为Toolbar的父布局容器,也可以配合CoordinatorLayout一起使用. ToolBar是谷歌新推出的代替Action

android material design

谷歌2015 I/O大会上,发布了Android新版本,为了能使用 这些 material design 组件,需要去更新最新的SDK中的Extras支持库 Android Support Library Android Support Repository 下面是android studio sdk manager 相关安装的截图: 更新完之后,在build.gralde文件添加依赖: 基于matterial design的组件: 1. FloatingActionButton (浮动按钮)

Material Design with the Android Design Support Library

Material Design with the Android Design Support Library 原文http://www.sitepoint.com/material-design-android-design-support-library/ Material Design,Android 5.0发布时为android app 和其他平台app引入的一门新的设计语言. 它带来了一些新的UI组件,如“Floating Action Button”.实施这些新组件,同时确保向后兼容

Material Design系列,自定义Behavior支持所有View

Material Design系列,自定义Behavior支持所有View 版权声明:转载必须注明本文转自严振杰的博客: http://blog.csdn.net/yanzhenjie1003 友情连接: Material Design博客专栏 系列博客: 1. Material Design系列,Behavior之BottomSheetBehavior与BottomSheetDialog 2. Material Design系列,Behavior之SwipeDismissBehavior 3.

Material Design Support 8大控件介绍

TextInputLayout 显示提示信息 能够通过调用setError()在EditText以下显示一条错误信息 FloatingActionButton 悬浮操作按钮 Snackbar 相当于底部吐司,但比toast有更强大的高速反馈机制 TabLayout 能够实现固定的选项卡,也实现可滚动的选项卡 Navigation View 在drawlayout实现側滑效果时,取代ListView要适配器的繁琐 1.app:headerLayout: 给NavigationView加入头部布局