簡體   English   中英

滾動時CoordinatorLayout內部的NestedScrollView的波浪效果不起作用

[英]Wave effect of NestedScrollView inside CoordinatorLayout is not working when scrolling

我使用CoordinatorLayout作為容器並使用NestedScrollView來顯示內容來進行布局。

向下滾動時,我使用NestedScrollView隱藏了我的工具欄,但是,當我嘗試滾動並達到布局限制時,通常應在工具欄下方顯示的普通波浪效果不起作用。

這里是

例

如何產生這種效果? 如果使用普通的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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM