<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Spinner
android:layout_margin="10dp"
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Listview
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="10dp"
android:weightSum="2"
>
<Listview
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:weightSum="2"
>
<Listview
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<Listview
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout >
</LinearLayout>
</LinearLayout>
刚试了下您的代码,好像不行。可能我没说清楚。
我的意思就是布局文件正好就像我画的那样。
Listview
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
这样写的话,如果第一个listview很多的话,下边肯定就跑出屏幕了。