<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_color"
android:orientation="vertical">
....一大堆控件....
</LinearLayout>
</androidx.core.widget.NestedScrollView>
上記は画面いっぱいに設定されていますが、実行による効果はそうではありません。
fillViewport 属性を追加
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_color"
android:orientation="vertical">
....一大堆控件....
</LinearLayout>
</androidx.core.widget.NestedScrollView>
NestedScrollView と ScrollView は同じです。