0
我需要實現與CollapsingToolbarLayout行爲類似的行爲。兩個大的差異,使這個小部件不適合我的目的:CollapsingToolbarLayout在獨立片段中的行爲
這不是工具欄的一部分。這是通過直接位於工具欄下方的片段膨脹的佈局,但不能是工具欄的子項。
當我滾動屏幕時,我想要上部框架佈局('header_fragment_container',填充了一個子片段),就像CollapsingToolbarLayout一樣摺疊。就像它那樣,我希望它被替換爲不同的佈局。
有誰知道一個合適的小部件或第三方庫,可以處理應用程序欄/工具欄以外的這種可摺疊性嗎?
下面是片段的XML作爲它存在的那一刻:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<FrameLayout
android:id="@+id/header_fragment_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"/>
<FrameLayout
android:id="@+id/content_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</ScrollView>