MD CoordinatorLayout & NestedSrolling机制

先看CoordinatorLayout能实现的效果:


CoordinatorLayout演示
herf:http://blog.csdn.net/huachao1001/article/details/51554608





herf:http://www.jianshu.com/p/488283f74e69


效果预览
herf:http://blog.csdn.net/yanzhenjie1003/article/details/51946749

herf:http://www.jianshu.com/p/f7989a2a3ec2

1.CoordinatorLayout介绍

官方对CoordinatorLayout的描述是这样的:

CoordinatorLayout is a super-powered FrameLayout.

CoordinatorLayout is intended for two primary use cases:

  • As a top-level application decor or chrome layout
  • As a container for a specific interaction with one or more child views

官方对Behavior的描述是这样的:

Interaction behavior plugin for child views of CoordinatorLayout.

简单来说,CoordinatorLayout是用来协调其子view们之间动作的一个父view,而Behavior就是用来给CoordinatorLayout的子view们实现交互的。


CoordenatorLayout 实现了两套机制
     
NestedScrolling机制
解决了 Touch时间分发的问题
Behavior机制