1.現象
NestedScrollView 中嵌套 LinearLayout,使用layout_weight不能生效
2 解決方案
NestedScrollView繼承於ScrollView,故添加屬性android:fillViewport="true"即可
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
...
android:fillViewport="true">
...
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
...
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
...