我在 scroll view
中包装了一个 Activity ,如下所示。
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<include layout="@layout/content_form" />
</ScrollView>
我在 content_form
布局中有大约 15 个字段,问题是 content_form
布局中的最后一项附在底部。
我需要在 ScrollView 下方添加边距,我已尝试为 scrollview
和 content_form
字段的最后一项提供边距,但没有任何效果。
我需要知道如何在使用 ScrollView
时在页面底部添加边距。
最佳答案
如果希望滚动边距在内容内,最好将其添加到content_form
。您应该能够通过将 paddingBottom
添加到该布局中的父容器,或者在最后一个与父底部对齐的 View 上添加 layout_marginBottom
来实现这一点。
关于android - 如何在 ScrollView 下方添加空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51027923/