我目前使用的是一个包含ScrollView内部的RelativeLayout的布局。Android paddingBottom无法工作没有填充顶部
我想要的RelativeLayout被包含在从滚动型的底部,所以它不重叠我有它背后的背景5DP走,要达到这个我就是用这个XML:
<ScrollView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/backgroundView1"
android:fadingEdge="none"
android:scrollbars="none"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<RelativeLayout
android:id="@+id/innerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
</ScrollView>
这完美地工作,但是我不再需要顶部的填充。在删除paddingTop行时,paddingBottom不再起作用。即使我将paddingBottom设置为100dp,它也不会影响我的布局。
我试图paddingTop =“0dp”,但这并没有解决任何问题,看来当paddingTop高于0
任何paddingBottom来只会工作,有任何想法,为什么paddingBottom来不无paddingTop工作?
我想你的代码,并当上填充是零它的工作原理。我使用相对布局作为父布局。 – Gan