Android : How can one drag an ImageView in Android?

on Thursday, October 9, 2014


I've spent some time researching this and still haven't found a great answer.


What I would like is to drag an ImageView around the screen. Not a drag and drop, but just an actual drag.


This tutorial has been helpful:


http://code.tutsplus.com/tutorials/android-gesture--mobile-2239


It works perfect, but it's designed to drag a bitmap, not an ImageView. I've tried replacing the Bitmap with an ImageView, but I'm not sure how the Canvas and ImageView interact in the onDraw method. I've tried imageView.draw(canvas); and that doesn't seem to work - the ImageView doesn't show up at all.


Any suggestions?


Thanks in advance.


0 comments:

Post a Comment