0

相対レイアウトを拡張してカスタムビューを作成しましたが、次のようになります。 代替テキスト

ビューのレイアウト:

<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
    <RelativeLayout android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:gravity="center_horizontal">
        <ImageView android:id="@+id/type_picture_preview"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:src="@drawable/type_picture_noimage" android:layout_alignParentRight="true"
            android:paddingTop="15dip" android:paddingRight="15dip" />
        <ImageView android:id="@+id/type_picture_delete" android:src="@drawable/type_picture_delete"
            android:layout_width="wrap_content" android:layout_height="wrap_content"
            android:layout_alignParentRight="true" />
    </RelativeLayout>
</merge>

1行に2つ以上のレイアウトを表示するのに苦労しています。私が間違っているアイデアはありますか?

4

2 に答える 2

0

LinearLayoutで容器として使用し、中に入れてorientation="vertical"くださいRelativeLayouts

于 2010-09-15T10:17:27.477 に答える
0

ディップを使用して幅/高さをハードコーディングする必要がありました。

于 2010-09-30T05:23:06.553 に答える