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"

AppBarLayout是Android 5.0引入的用于实现材料设计应用栏功能的布局,它支持滚动手势。通常配合CoordinatorLayout使用,并通过setScrollFlags或XML属性设置滚动行为。本文介绍了如何在XML中添加布局文件,设置滚动行为,以及提供了一个使用AppBarLayout的例子和官方API链接。
最低0.47元/天 解锁文章
1046

被折叠的 条评论
为什么被折叠?



