前言#
上一篇文章承诺会讲解折叠伸缩的效果,所以废话不多说
上gif#
Gank2.gif
一句话#
当你初次看见这样的效果可能会觉得实现起来比较麻烦。而我告诉你,只需要正确的配置XML中的控件即可.
上代码#
请结合讲解模块一起阅读
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOver