Most visited

Recently visited

Added in API level 11

View.OnDragListener

public static interface View.OnDragListener

android.view.View.OnDragListener


将拖动分派到此视图时调用回调的接口定义。 回调将在托管视图自己的onDrag(event)方法之前被调用。 如果侦听器想要回退到托管视图的onDrag(event)行为,它应该从该回调中返回'false'。

Developer Guides

有关实现拖放功能的指南,请阅读 Drag and Drop开发人员指南。

Summary

Public methods

abstract boolean onDrag(View v, DragEvent event)

当拖动事件被分派到视图时调用。

Public methods

onDrag

Added in API level 11
boolean onDrag (View v, 
                DragEvent event)

当拖动事件被分派到视图时调用。 这允许监听者有机会覆盖基本的View行为。

Parameters
v View: The View that received the drag event.
event DragEvent: The DragEvent object for the drag event.
Returns
boolean true if the drag event was handled successfully, or false if the drag event was not handled. Note that false will trigger the View to call its onDragEvent() handler.

Hooray!