Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用relativelayout使android中的图像重叠_Java_Android_Image_Android Layout_Android Relativelayout - Fatal编程技术网

Java 如何使用relativelayout使android中的图像重叠

Java 如何使用relativelayout使android中的图像重叠,java,android,image,android-layout,android-relativelayout,Java,Android,Image,Android Layout,Android Relativelayout,考虑上图 红线表示图像文件边框,黑线表示图像的实际“有用”像素,白线表示透明 我该如何将这些图像以这种方式定位 我不确定这是否会对上述操作方式产生影响,但我计划对每个图像执行基本动画(使每个图像相对于各自的中心旋转) 这就是我到目前为止所做的(将3个元素放在中间,相互重叠): <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/

考虑上图

红线表示图像文件边框,黑线表示图像的实际“有用”像素,白线表示透明

我该如何将这些图像以这种方式定位

我不确定这是否会对上述操作方式产生影响,但我计划对每个图像执行基本动画(使每个图像相对于各自的中心旋转)

这就是我到目前为止所做的(将3个元素放在中间,相互重叠):


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

<ImageView 
    android:id="@+id/img_1"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
android:contentDescription = "@string/img1"
    android:src="@drawable/img1"

<ImageView
    android:id="@+id/img_2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:contentDescription="@string/img2"
    android:rotation="45"
    android:src="@drawable/img2" />

<ImageView
    android:id="@+id/img_3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:contentDescription="@string/img3"
    android:rotation="200"
    android:src="@drawable/img3" />