【发布时间】:2020-01-25 20:38:04
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".list1">
<ImageView
android:id="@+id/sinb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/left"
android:padding="10dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
/>
<ListView
android:layout_below="@id/sinb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView1"
android:layout_marginTop="30dp"
android:layout_centerHorizontal="true"
android:choiceMode="multipleChoice" />
<Button
android:id="@+id/btn1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/listView1"
android:text="submit"/>
</RelativeLayout>
我已将这些放在相对布局中。我已尝试使用 ScrollView,但它不起作用。我想要的是一个提交按钮应该显示在 Listview 下方,当列表增长并离开屏幕时,活动变得可滚动并且按钮应该显示在 listview 的末尾下方。
【问题讨论】:
-
你有什么特殊的原因要尝试在另一个垂直滚动视图中显示垂直滚动列表吗?
-
我只希望用户看到所有列表项,然后单击提交按钮,而不是之前。所以该按钮直到列表末尾才可见
-
在下面查看我的答案
-
不可能,使用recyclerView或者LinearLayout都可以
标签: android listview scroll xml-layout