This is my layout which i tried so far without any success
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white">
<LinearLayout
android:id="@+id/lltest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/inside_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:src="@drawable/frame"/>
</LinearLayout>
<ImageView
android:id="@+id/outside_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/inside_imageview"
android:scaleType="fitXY"/>
</RelativeLayout>
What i exactly want is to have my outside_imageview on top of inside_imageview with the exact height and width… How to do it through layout?
The
layout_align[Top|Bottom|Left|Right]attribute inRelativeLayoutis used to align views based on their respective x and y values within the margin. The secondImageViewwill now be aligned to the top, bottom, left, and right of the firstImageViewbased on the margins. Padding is ignored in the alignment.