【发布时间】:2013-06-11 17:13:00
【问题描述】:
我用 ObjectAnimator 旋转了一个 TextView,如下所示:
ObjectAnimator rotate = ObjectAnimator.ofFloat(aRotatedTextView, "rotation", 0f, someAngle);
现在,我尝试像这样在长按时拖放旋转的(!)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;
}
会发生什么是 DragShadow 是在没有旋转的情况下创建的(角度==0)。我已经看到很多我无法使用的位图示例(但不是旋转)。 有没有办法创建一个旋转的 DragShadow?
【问题讨论】:
标签: android drag-and-drop rotation