【问题标题】:Why do we need AppBarLayout when we are using CollapsingToolbarLayout?为什么我们在使用 CollapsingToolbarLayout 的时候需要 AppBarLayout?
【发布时间】:2017-03-19 15:42:42
【问题描述】:

另外,appbar 布局和折叠工具栏布局有什么区别?

非常感谢:)

【问题讨论】:

    标签: android android-layout android-collapsingtoolbarlayout android-appbarlayout


    【解决方案1】:

    AppBarLayout 是一个垂直的LinearLayout,它实现了 Material Design 应用栏概念的许多功能,即滚动手势。

    儿童应通过setScrollFlags(int) 和相关的布局xml 属性提供他们想要的滚动行为:app:layout_scrollFlags

    此视图在很大程度上取决于在 CoordinatorLayout 中用作直接子级。如果您在不同的ViewGroup 中使用AppBarLayout,它的大部分功能都将不起作用。

    CollapsingToolbarLayoutToolbar 的包装器,它实现了一个可折叠的应用栏。它旨在用作AppBarLayout 的直接子代。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-07-17
    • 2021-12-25
    • 1970-01-01
    • 1970-01-01
    • 2020-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多