我有一个主要产品图片,它始终显示在我的ImageView
中。现在有可能有几个叠加(与原始图像大小相同,但有很多透明区域)。
所有这些图片都来自远程网址。 E.g:
是否可以将所有这些加载到一个ImageView
?
答案 0 :(得分:0)
您可以拥有自定义ImageView
,load bitmaps with Picasso,然后在画布上绘制这些位图:
@Override
protected void onDraw(final Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap(bitmap1, 0, 0, null); // lower image
canvas.drawBitmap(bitmap2, 0, 0, null); // upper image
}
答案 1 :(得分:-1)
你可以尝试这个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>