<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="always">
<!-- 放置你的内容 -->
</androidx.core.widget.NestedScrollView>
设置overScrollMode
为always
可以确保在内容未充满页面时也能有回弹效果。
注:不能填满屏幕、内部layout_weight无效--> android:fillViewport="true"