将图像覆盖在另一个 android 上 [英] Overlay image over another android
本文介绍了将图像覆盖在另一个 android 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有相册显示图像为带有白色边框的圆形.图像将动态添加.我尝试了框架布局,但它对我不起作用.我的尝试:在现有圆形图像上添加动态图像..
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>
这将完成您的任务.
快乐编码 :)
这篇关于将图像覆盖在另一个 android 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文