Android:将图片放在另一张图片上 [英] Android:Put an image over another image

查看:633
本文介绍了Android:将图片放在另一张图片上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个ImageViews,我希望1个ImageView在背景中,其他2张图像应放在该图像上.我无法使用任何其他视图,因为图像是以无法设置为LinearRelative布局背景的图像形式下载的.

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.

第一张图片

这是我实际上想要的第二张图片

THIS IS THE SECOND IMAGE WHAT I WANT ACTUALLY

推荐答案

您可以尝试以下xml布局...

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>

这篇关于Android:将图片放在另一张图片上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆