【发布时间】:2021-09-19 15:07:23
【问题描述】:
我正在尝试将 EditText 放在 ListView 之上。使用相对布局,EditText 和 ListView 都放置在屏幕上,但文本字段与页面顶部的列表视图混合。我添加了一些空白空间,但没有工作。 如何分离edittext和listview。这是我现在的代码。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".InvoiceSearchList">
<EditText
android:id="@+id/invoiceSearchFilter"
android:layout_width="match_parent"
android:layout_height="50sp"
android:hint="Search invoice"
/>
<ListView
android:id="@+id/listViewInvoiceSearchList"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
【问题讨论】:
-
至少从图片上看,
ListView似乎在EditText之上。您可以尝试更改它们的顺序。
标签: xml android-studio android-layout android-listview android-edittext