I am trying to give a border to an image view using a layout to wrap it and set the border as background to that particular layout. However the image view appears small and in the top left corner of the frame background.
Here is my code:
<RelativeLayout
android:id="@+id/Relative1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:background="@drawable/pic_frame_big_01" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
</RelativeLayout>
How can I modify this code so that image fits into the relative layout and occupies it.
EDIT Changed the code of ImageView the image is centered now, but it appears as a very small image centered in the parent.
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />