0
因此,在我的activity_page.xml
中,我最初的android:layout_marginBottom="75dp"
是最底部的線性佈局。它適用於大多數頁面,但在某些文章太長的情況下,某些元素會消失,我必須將大小更改爲100dp或125dp,以使元素再次出現,但在文章較短的情況下,額外的空白變得討厭。有沒有辦法自動調整大小?我該如何讓android佈局頁邊距自動調整爲頁面長度
因此,在我的activity_page.xml
中,我最初的android:layout_marginBottom="75dp"
是最底部的線性佈局。它適用於大多數頁面,但在某些文章太長的情況下,某些元素會消失,我必須將大小更改爲100dp或125dp,以使元素再次出現,但在文章較短的情況下,額外的空白變得討厭。有沒有辦法自動調整大小?我該如何讓android佈局頁邊距自動調整爲頁面長度
使用滾動視圖。
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</ScrollView>
爲什麼不使用scrollview作爲parent.It調整視圖如果屏幕很小。 – Anonymous