小编use*_*481的帖子

如何拖动旋转的DragShadow?

我用ObjectAnimator旋转了TextView,如下所示:

ObjectAnimator rotate = ObjectAnimator.ofFloat(aRotatedTextView, "rotation", 0f, someAngle);
Run Code Online (Sandbox Code Playgroud)

现在,我尝试在长按上拖放旋转的(!)TextView,如下所示:

public boolean onLongClick(View view) {
    ClipData data = ClipData.newPlainText("DragData", (String) view.getTag());
    DragShadowBuilder dragShadowBuilder = new View.DragShadowBuilder(view);
    mDragInProgress = view.startDrag(data, dragShadowBuilder, view, 0);
    view.setVisibility(View.INVISIBLE);
    return true;
}
Run Code Online (Sandbox Code Playgroud)

会发生什么是在没有旋转的情况下创建DragShadow(角度== 0).我已经看到了很多位图(但没有旋转)的例子,我无法工作.有没有办法创建旋转的DragShadow?

android drag-and-drop rotation

3
推荐指数
1
解决办法
949
查看次数

标签 统计

android ×1

drag-and-drop ×1

rotation ×1