简体   繁体   English

在Android中查看重叠图像

[英]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 我需要创建一个包含两个图像的布局。(我将图像文件附加到一起)。图像应该使得第一个图像与第二个图像重叠。某些物体可以帮助我,因为我是android的新手实际上有两个图像,一个是普通图像,另一个是带有斜线,我想使生成的图像看起来像以下内容 在此处输入图片说明

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. 这将使项目彼此重叠。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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