我目前使用的是一個包含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