Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.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
在android中将可拖动图像添加到另一个图像上的最佳方法_Android - Fatal编程技术网

在android中将可拖动图像添加到另一个图像上的最佳方法

在android中将可拖动图像添加到另一个图像上的最佳方法,android,Android,我想知道在安卓系统中添加可拖动图像到另一个图像的最佳方法是什么。例如,如果我有一张某人的脸的图像,我怎么能添加一张较小的图像,比如一张喜剧嘴,并将其拖到原始图像上的正确位置。有什么好办法吗 提前感谢您可以使用FrameLayout重叠图像。请查看以下内容: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" andro

我想知道在安卓系统中添加可拖动图像到另一个图像的最佳方法是什么。例如,如果我有一张某人的脸的图像,我怎么能添加一张较小的图像,比如一张喜剧嘴,并将其拖到原始图像上的正确位置。有什么好办法吗


提前感谢

您可以使用FrameLayout重叠图像。请查看以下内容:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">

   <ImageView 
      android:id="@+id/imageView1"
      android:src="@drawable/img_face"
      android:scaleType="fitCenter"
      android:layout_height="250px"
      android:layout_width="250px"/>

   <ImageView
     android:id="@+id/imageView2"
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:src="@drawable/comedy_face"
      android:gravity="center"/>
</FrameLayout>

您可以使用FrameLayout重叠图像。请查看以下内容:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent">

   <ImageView 
      android:id="@+id/imageView1"
      android:src="@drawable/img_face"
      android:scaleType="fitCenter"
      android:layout_height="250px"
      android:layout_width="250px"/>

   <ImageView
     android:id="@+id/imageView2"
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:src="@drawable/comedy_face"
      android:gravity="center"/>
</FrameLayout>


此网站不适合您进行编程。找到解决问题可能需要的编程结构,如果其中任何一个存在特定问题,请返回。在应用程序中重叠图像的最佳方法是使用FrameLayout。请检查下面的答案。此网站不适用于您的编程。找到解决问题可能需要的编程结构,如果其中任何一个存在特定问题,请返回。在应用程序中重叠图像的最佳方法是使用FrameLayout。请检查下面的答案。这是否适用于多个新图像?假设可以将眼镜和嘴巴添加到原始图像中。是的,在FrameLayout中,您可以添加任意数量的图像。请尝试一次,如果不起作用,请发布您的代码,以便我们可以帮助您。@jvdm但这对多个新图像有效吗?假设可以将眼镜和嘴巴添加到原始图像中。是的,在FrameLayout中,您可以添加任意数量的图像。请尝试一次,如果不起作用,请发布您的代码,以便我们可以帮助您。@JVDM