简体   繁体   中英

Overlap images in view in android

I need to create a layout containing two images .(I am attaching the image file along).The images should be such that the first should overlap over the second.Can some body please help me as i am a newbie to android any help will be appreciable.There are actually two images one plain image and another having slanting lines.I want to make the resultant image appear something like the following 在此处输入图片说明

you need a frame layout something like this:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:orientation="vertical"
       android:layout_width="match_parent"
       android:layout_height="match_parent">
  <ImageView
            android:id="@+id/image1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:src="@drawable/image1"/>
  <ImageView
            android:id="@+id/image2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:src="@drawable/image2"/>

This will layout items on top of each other. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM