如何使用多个imageViews进行单个视图? 我知道这只是一个简单的问题,但它对我来说是难题... 问题 有4个图像用于整个背景图像,第二个图像是透明的心脏,而3张图像是将心放在心中,而4张图像是心脏的阴影图像,但是如何在单个视图(任何布局)中管理这四个图像。... 任何帮助都将不胜感激,请参阅链接以查看我所需的输出 链接查看照片 update 我已将亲戚用于背景图像和FRAMELAYOUT显示两个图像视图以显示一个图像,以显示Lamp Image,第二个移动作为背景(用户选择的图像)。 问题: 问题是选择的用户必须仅移动在灯内。 更新阅读评论以获取答案<RelativeLayout
android:id="@+id/relativelayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/hv_effect"
android:layout_below="@+id/effect_hedaer_toolbar"
android:background="@drawable/home_wall"
android:weightSum="1">
<FrameLayout
android:id="@+id/relative_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center|center_vertical"
android:padding="50dp">
<ImageView
android:id="@+id/iv_effect_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<ImageView
android:id="@+id/iv_effect_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center|center_vertical"
android:adjustViewBounds="false"
android:scaleType="fitXY"
android:src="@drawable/pip" />
</FrameLayout>
</RelativeLayout>
我敢肯定,您只需使用Relativelayout即可完成此操作。透明图像应该是布局中的最后一个,例如:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/background_image"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/transparent_image"/>
</RelativeLayout>