我有一个滚动视图,其中包含一堆相对布局,这些布局超出了屏幕的高度。 如何添加带有2个"粘贴"到屏幕底部的按钮的线性布局。 这意味着无论我如何滚动滚动视图,线性布局都将始终出现在屏幕底部。
问题已经在这里回答。 请检查stackoverflow.com/a/42864776/2010056
android:id="@+id/RelativeLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:id="@+id/my_scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="72dip"
android:layout_above="@+id/LinearLayout01"
android:scrollbars="horizontal">
android:id="@+id/LinearLayout01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true">
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"">
android:id="@+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
是的 它不是可编译的,而是正确的答案。 即这个想法是正确的。 只需在之前声明
您可以使用RelativeLayout来实现。
ScrollView应该放置在按钮栏上方和标题下方(如果适用)。
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_above="@+id/myFooter">
android:layout_alignParentBottom="true" android:layout_height="wrap_content"
android:layout_width="fill_parent">
+1 ya 321x是正确的,如果它不起作用,则只需将myFooter布局放在您的滚动视图中,然后尝试起作用....谢谢。