在Android XML中的两个按钮之间插入ListView

在Android XML中的两个按钮之间插入ListView,android,xml,button,android-listview,Android,Xml,Button,Android Listview,我有一个概念xml,如下所示,如何在两个按钮之间插入listview? 这是我的xml代码,我应该在代码中添加或更改什么 main.xlm 请使用下面的代码 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:lay

我有一个概念xml,如下所示,如何在两个按钮之间插入listview?

这是我的xml代码,我应该在代码中添加或更改什么

main.xlm
请使用下面的代码

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Main" >

<Button
    android:id="@+id/btn_add_contact"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Add New Moment" />

<ListView
    android:id="@+id/lv_contact_list"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" />

<Button
    android:id="@+id/btn_add_contact"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Back To Main Menu" />

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".Main" >

<Button
    android:id="@+id/btn_add_contact"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Add New Moment" />

<ListView
    android:id="@+id/lv_contact_list"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" />

<Button
    android:id="@+id/btn_add_contact"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Back To Main Menu" />