我有一個帶有RelativeLayout的ScrollView。 我會在底部有2/3個按鈕,但他們不會停留在底部。 任何人都可以看到我做錯了什麼地方?滾動視圖底部的Android按鈕
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/activity_bygg"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="110dp"
android:layout_height="wrap_content"
android:text="@string/hjem"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/>
<Button
android:layout_width="110dp"
android:layout_height="wrap_content"
android:text="@string/neste"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</ScrollView>
通過將RelativeLayout高度更改爲match_parent來進行嘗試。 – dex
scrollview是框架佈局,爲什麼你的RelativeLaoyout應該到底?不要嘗試使用(相對(滾動,按鈕,按鈕))? – mmprog