Is it possible to make a drag shadow opaque?

前端 未结 5 1056
粉色の甜心
粉色の甜心 2020-12-16 06:14

As question states. here is my dragshadowbuilder for reference. As you know, the shadow that is created when you drag is translucent. Is there anyway to make it opaque? (ful

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-16 06:23

    I think the proper way to achieve this is:

    /* Create the shadow from a view */
    View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
    /* Access the view created and set the alpha of it to 1 (totally opaque)*/
    shadowBuilder.getView().setAlpha(1);
    /* Start dragging the object */
    view.startDrag(data, shadowBuilder, view, 0);
    

    EDIT It doesn't seem to work on 4.4 and beyond :(

提交回复
热议问题