【问题标题】:Android - Problemn when setting visibility in CoordinatorLayoutAndroid - 在 CoordinatorLayout 中设置可见性时出现问题
【发布时间】:2015-10-01 22:17:37
【问题描述】:

当我将 CoordinatorLayout 作为父视图的可见性更改为 GONE 时,AppBarLayout 已经发生,但是当我使用 LinearLayout 时,我没有这个问题。

我想在滚动 RecyclerView 时为 AppBarLayout 的滑动使用 CoordinatorLayout。

【问题讨论】:

  • 你说的是哪个布局的可见性(GONE)? AppBarLayout 已经发生是什么意思?您可以发布一些代码并在问题中说明问题吗?
  • 看截图
  • 你也可以发布布局xml文件吗?

标签: android android-linearlayout android-coordinatorlayout


【解决方案1】:

首先在您的AppBarLayout 中添加:

app:layout_scrollFlags="scroll"

你应该在 FrameLayout 中添加:

app:layout_behavior="@string/appbar_scrolling_view_behavior"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-16
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 2019-04-15
    • 2011-07-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多