Android View.DragShadowBuilder拖动

2018-08-14  本文已影响106人  yunhen
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);

    }
上一篇下一篇

猜你喜欢

热点阅读