0

I have created a custom view by extending Relative Layout and it looks like this: alt text

The layout for the view:

<?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>

I am struggling to get two or more layouts on a single line. Any ideas where I am going wrong?

Sameer Segal
  • 21,813
  • 7
  • 42
  • 56

2 Answers2

0

Use LinearLayout as a container with the orientation="vertical" and place your RelativeLayouts inside

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
0

I had to hard code the width/height using dips.

Sameer Segal
  • 21,813
  • 7
  • 42
  • 56