我正在尝试在一个片段中显示两个列表视图。但我在 xml 文件本身中遇到问题。我正在使用夏洛克片段。此外,一个列表应显示在屏幕的 2/3 空间上,另一个列表应显示在屏幕空间的 1/3 上。请问你能帮忙吗?任何帮助,将不胜感激。提前致谢。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#DEF7C6"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/layout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="60dp"
android:layout_height="35dp"
android:paddingLeft="0dp"
android:src="@drawable/search" />
<EditText
android:id="@+id/EditText01"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:hint="Search"
android:paddingLeft="50dp"
android:textColor="#000000" >
</EditText>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/EditText01"
android:drawSelectorOnTop="false"
android:listSelector="@android:color/darker_gray" >
</ListView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#CFCACC" >
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/layout1"
android:layout_weight="2" >
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000000" />
</RelativeLayout>
<Button
android:id="@+id/addbutton"
android:layout_width="42dp"
android:layout_height="41dp"
android:layout_above="@+id/list"
android:layout_alignParentRight="true"
android:background="@drawable/buttonadd" />
</RelativeLayout>