Scrollview と LinearLayout をその子として持っています。私は Linearlayout の layout_gravity を "bottom" に設定しました。これは、layoutgravity "bottom" によって下にドラッグされるいくつかのカスタム ビューを Linerarlayout にプログラムで追加したいからです。"top" を layout_gravity として試してみましたが、scrollview は正常にスクロールしますが、"bottom" に設定するとスクロールしなくなります (カスタムビューは既に挿入されており、利用可能な高さよりも多くの高さが必要です)。
助言がありますか?前もって感謝します !
これが私のコードです:
<ScrollView
android:layout_width="match_parent"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:background="#fff"
android:id="@+id/scrollView"
android:fillViewport="true"
android:scrollbars="none"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:id="@+id/linearLayout"
android:layout_gravity="bottom"
android:layout_height="match_parent">
<!--Here are a few custom views added via code-->
</LinearLayout>
</ScrollView>