I found a lot of methods to create round corners on ImageView. They all work while the imageView and its parent layout are set to wrap_content or match_parent. But the layout of my application requires a fixed height and width, so those methods don't work.
Here's my XML (the "Preview" ImageView MUST align the "Name" text field on the top and "Phone" on the bottom. I tried setting the imageview and its parent layout to "wrap content" and set a MaxWidth and MaxHeight for the ImageView, but it did not work horizontally, so the 3 text fields on the right get pushed off the screen. I need some help to re-construct the layout the way it works with "wrap_content" for "preview" and its parent layout OR find a find a method for creating round corners that works with a fixed layout size (actually I tried 3 or 4).
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="60dp"
android:layout_height="158dp"
android:layout_alignParentRight="true"
android:layout_marginRight="7dp"
android:layout_marginTop="38dp"
android:layout_toRightOf="@+id/RL_ImageHolder" >
<EditText
android:id="@+id/Name"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:background="@drawable/form_m_6"
android:gravity="top"
android:hint="Name"
android:padding="5dp" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/Surname"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/Name"
android:layout_marginLeft="5dp"
android:layout_marginTop="19dp"
android:background="@drawable/form_m_6"
android:gravity="top"
android:hint="Surname"
android:padding="5dp" />
<EditText
android:id="@+id/etPhone"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:background="@drawable/form_m_6"
android:gravity="top"
android:hint="Phone number"
android:inputType="phone"
android:padding="5dp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/RL_ImageHolder"
android:layout_width="140dp"
android:layout_height="158dp"
android:layout_alignBottom="@+id/relativeLayout2"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/relativeLayout2"
android:layout_marginLeft="10dp" >
<ImageView
android:id="@+id/imgPreview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="140dp"
android:maxHeight="160dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:contentDescription="Preview"
/>
</RelativeLayout>