如何将图像拖到 canvas 上?

How can I drag images onto the canvas?

我正在开发一个加载图像并在 camvas 中绘制以对其进行编辑的应用程序,但我想添加一个部分来显示图像列表,用户可以将图像拖放到canvas,但我被锁定在后一个函数中有人有执行此功能的示例或方法吗?

this Android Developers tutorial covers just what you need - a drag and drop process of an image. If you want an even more detailed tutorial, this Android Developers page解释的很好

简而言之,您必须使用从 View class 继承的 onTouchEvent 方法来检测和应用拖放过程。