How to make Drag & Drop Button in Android

前端 未结 4 747
既然无缘
既然无缘 2020-12-03 03:42

I want to make a drag and drop button. Drag it where you want it to do and it stays there. Below code only scales the button, doesn\'t change its position.

p         


        
4条回答
  •  臣服心动
    2020-12-03 04:24

    Maybe the answers should be improved, because this question is still very prominent when you google fot it.

    Today there is a Framework which can be used for drag and drop. It was introduced with Android 4.

    You can find a nice tutorial at Google developer page:
    https://developer.android.com/guide/topics/ui/drag-drop.html

提交回复
热议问题