Android – Bring an ImageView in front of another

androidimageview

Is there anyway to bring an ImageView in front of another in android . For example , i have a big image and how i put a small one in the top left of the big ones. Something like the small one will overlap the bigs one . thanks for helping

Best Answer

Wrap the images in a RelativeLayout. Place the image you want on top last in the xml, like so:

<RelativeLayout
    ...>
    <ImageView
        android:background="@drawable/backgroundimage"
        ... />
    <ImageView
        android:background="@drawable/foreground"
        ... />
</RelativeLayout>