0

私はlayout.xmlを含めています:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:background="@color/grey" >

    <RelativeLayout
        android:id="@id/layout_content_magthumb"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:background="@color/grey" >

        <ImageView
            android:id="@id/content_thumb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="@dimen/padding_large"
            android:src="@drawable/cover1" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@id/layout_content_list"
        android:layout_width="100dp"
        android:layout_height="fill_parent"
        android:layout_toRightOf="@id/layout_content_magthumb"
        android:layout_toLeftOf="@id/layout_content_description"
        android:background="@color/yellow" >

        <ListView
            android:id="@id/list_content"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" >
        </ListView>
    </RelativeLayout>

    <RelativeLayout
        android:id="@id/layout_content_description"
        android:layout_width="wrap_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:background="@android:color/darker_gray" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="@dimen/padding_large"
            android:src="@drawable/cover2" />
    </RelativeLayout>

</RelativeLayout>

私が直面している問題は、レイアウトに ListView を含めるたびに、左の RelativeLayout のレイアウト スペースを除くレイアウト全体を占有することです。

提案してください。

4

1 に答える 1

-1

を含むに重み0.1または何か他のものを割り当ててみてください:RelativeLayoutListView

android:layout_weight="0.1"
于 2012-07-10T07:37:43.533 に答える