gpt4 book ai didi

android - CoordinatorLayout 中的 NestedScrollView 的波浪效果在滚动时不起作用

转载 作者:行者123 更新时间:2023-11-29 02:25:52 25 4
gpt4 key购买 nike

我使用 CoordinatorLayout 作为容器并使用 NestedScrollView 来显示我的内容。

我使用 NestedScrollView 来在向下滚动时隐藏我的工具栏,但是每当我尝试滚动并达到布局限制时应该显示在工具栏下方的通常的波浪效果不起作用。

这是

example .

这个效果是怎么做出来的?如果我使用普通的 ScrollView,将显示此效果,但我无法隐藏我的工具栏。

这是我的布局:

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.dicoding.paul.moviecatalog.DetailActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ToolbarTheme">

<android.support.v7.widget.Toolbar
android:id="@+id/tb_my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:elevation="4dp"
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ToolbarTheme"
app:layout_scrollFlags="scroll|enterAlways"
app:title="Detail"
app:titleTextAppearance="@style/ToolbarTheme.TitleText"/>
</android.support.design.widget.AppBarLayout>

<include layout="@layout/activity_detail_content"/>

</android.support.design.widget.CoordinatorLayout>

这是我的详细内容:

<android.support.v4.widget.NestedScrollView
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="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
//contents
//contents
</android.support.v4.widget.NestedScrollView>

最佳答案

试试这个:

android:clipToPadding="false"

在您的 NestedScollView 中。

关于android - CoordinatorLayout 中的 NestedScrollView 的波浪效果在滚动时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52243941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com