在另一个机器人叠加图像 [英] Overlay image over another android

查看:134
本文介绍了在另一个机器人叠加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的相册,显示图像为圆形白色边框。图像将被动态地添加。我试过框架布局,但它不是为我工作。我的尝试:添加动态图像上已经存在的圆形图像。

I have photo album which shows the image as rounded with white border. Image will be adding dynamically. I tried frame layout but it it not working for me. My try : Adding dynamic image over already existing round shape image..

<FrameLayout
   android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<ImageView 
    android:id="@+id/image"
    android:layout_width="60dip"
    android:layout_height="60dip"
    android:adjustViewBounds="true"
    android:scaleType="centerCrop" />

<ImageView 
    android:id="@+id/imagef"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:background="@drawable/ph_bg" />
</FrameLayout>

以上的XML没有给予确切的结果..任何想法?

Above xml not giving exact result .. any idea ?

推荐答案

使用以下XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/image"
        android:layout_width="60dip"
        android:layout_height="60dip"
        android:adjustViewBounds="true"
        android:layout_centerInParent="true"
        android:scaleType="centerCrop" />

    <ImageView
        android:id="@+id/imagef"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:background="@drawable/ph_bg" />

</RelativeLayout>

这会做你的任务。

编程快乐:)

Happy coding :)

这篇关于在另一个机器人叠加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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