シンプルな線形レイアウトで listView のサイズを設定する必要があります。私は最愛の例のように重みを設定しましたが、何かがうまくいかなかった: textView が設定されていないようで、リストはより大きな次元を取ります。
<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"
android:weightSum="1" >
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.2"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.7">
</ListView>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="0.1"
android:text="Avanti" />
</LinearLayout>
最終的なエラーを修正するにはどうすればよいですか?
これは私が持っているものです: