저는 Android에 익숙하지 않고 선형 레이아웃으로 작업하고 있습니다. 화면의 20 %를 차지하는 이미지를 배치하고 싶습니다. 여기에 코드가 있지만 작동하지 않습니다.android 용 LinearLayout의 layout_weight가 작동하지 않습니다.
<?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 %를 차지합니다.
내 코드에 어떤 문제가 있습니까?