Java 如何使用relativelayout使android中的图像重叠
考虑上图 红线表示图像文件边框,黑线表示图像的实际“有用”像素,白线表示透明 我该如何将这些图像以这种方式定位 我不确定这是否会对上述操作方式产生影响,但我计划对每个图像执行基本动画(使每个图像相对于各自的中心旋转) 这就是我到目前为止所做的(将3个元素放在中间,相互重叠):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/
<?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" />