Skip to content Skip to sidebar Skip to footer

Android, How To Put An Image Over Another Image?

In my project I have a menu. for design of menu i want to use gridView. for simplicity assume that this grid view has just one item. This item has two seperate images (background.

Solution 1:

Yes you can always do that using FrameLayout in xml file,Like this.

<FrameLayout android:id="@+id/frameLayout1"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:src="@drawable/background"></ImageView>
    <ImageView android:id="@+id/imageView2" android:layout_width="wrap_content"
        android:layout_gravity="center" android:layout_height="wrap_content"
        android:src="@drawable/news"></ImageView>
    <TextView android:text="NEWS" android:id="@+id/textView1" android:layout_gravity="bottom|center_horizontal"
        android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</FrameLayout>

Post a Comment for "Android, How To Put An Image Over Another Image?"