美文网首页
Android View.DragShadowBuilder拖动

Android View.DragShadowBuilder拖动

作者: yunhen | 来源:发表于2018-08-14 15:18 被阅读106次
    private void testStartDrag(View v) {
            View.DragShadowBuilder dragShadowBuilder = new View.DragShadowBuilder(v);
            v.setOnDragListener(new View.OnDragListener() {
                @Override
                public boolean onDrag(View v,DragEvent event) {
                    return false;
                }
            });
            v.startDrag(null,dragShadowBuilder,null,0);
            //震动反馈
            v.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
    
        }
    

    相关文章

      网友评论

          本文标题:Android View.DragShadowBuilder拖动

          本文链接:https://www.haomeiwen.com/subject/dprvbftx.html