Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android:Put an image over another image

I have three ImageViews and i want 1 ImageView to be in the background and the other 2 images should be laying on that one. I cannot use any other view because the image is downloaded in the image form that cannot be set as Linear or Relative layout background.

FIRST IMAGE

enter image description here

THIS IS THE SECOND IMAGE WHAT I WANT ACTUALLY

enter image description here

like image 717
Abid Khan Avatar asked Feb 26 '14 06:02

Abid Khan


1 Answers

You can try as below xml layout...

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true" >

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/ic_launcher"
        android:scaleType="fitXY" />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="100dip"
        android:background="@drawable/ic_launcher" />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|center_horizontal"
        android:layout_marginBottom="100dip"
        android:background="@drawable/ic_launcher" />

</FrameLayout>
like image 97
Hamid Shatu Avatar answered Oct 17 '22 23:10

Hamid Shatu