本文实例为大家分享了Android实现悬浮图片的具体代码,供大家参考,具体内容如下 @SuppressLint(AppCompatCustomView) public class MoveImageView extends ImageView { //按下那一刻的坐标和 控件上下左右距离 private float lastX; private float lastY; private int left; private int top; private int right; private int bottom; //如果是拖动事件就不用响应点击事件 boolean