Android 5.0新控件 AppBarLayout | 嵌套布局 介绍及使用详情
extends LinearLayout
AppBarLayout is a vertical LinearLayout which implements many of the features of material designs app bar concept, namely scrolling gestures.
嵌套布局是一个垂直的LinearLayout,其实现了许多的材料设计应用栏概念的特征,像滚动手势
- AppBarLayout通常直接作为CoordinatorLayout的直接子View使用,否则它的大部分功能将失效。
- 它的子View通过setScrollFlags(int)或XML属性:app:layout_scrollFlags来设置滚动行为
下面是官方给出的事例
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"