onLongPress 和 onShowPress 的区别
Difference between onLongPress and onShowPress
根据 Android 开发人员:
onLongPress
Notified when a long press occurs with the initial on
down MotionEvent that trigged it.
onShowPress
The user has performed a down MotionEvent and not performed a move or
up yet. This event is commonly used to provide visual feedback to the
user to let them know that their action has been recognized i.e.
highlight an element.
我都尝试了一个按钮,并使用 Toast
来表示 showPress
和 longPress
发生了。但是,我看不出有什么不同。
onLongPress
和 onShowPress
有什么区别?当我们 override
GestureDetector
那些 MotionEvents
时有哪些例子?
根据 Android 开发人员:
onLongPress
Notified when a long press occurs with the initial on down MotionEvent that trigged it.
onShowPress
The user has performed a down MotionEvent and not performed a move or up yet. This event is commonly used to provide visual feedback to the user to let them know that their action has been recognized i.e. highlight an element.
我都尝试了一个按钮,并使用 Toast
来表示 showPress
和 longPress
发生了。但是,我看不出有什么不同。
onLongPress
和 onShowPress
有什么区别?当我们 override
GestureDetector
那些 MotionEvents
时有哪些例子?