私はアンドロイドが初めてで、線形レイアウトで作業しています。画面の 20% を占める画像を配置したいと考えています。ここにコードがありますが、これは機能しません。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/sky" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="2" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/schoolroad" />
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="8" >
</RelativeLayout>
</LinearLayout>
その結果、左側のレイアウトが画面の 80% を占めます。
コードの何が問題になっていますか?