Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
280 views
in Technique[技术] by (71.8m points)

android - onLongPress和onShowPress之间的区别(Difference between onLongPress and onShowPress)

According to Android Developers:

(根据Android开发人员的说法:)

onLongPress Notified when a long press occurs with the initial on down MotionEvent that trigged it.

(onLongPress在长onLongPress触发了它的初始onLongPress通知。)

onShowPress The user has performed a down MotionEvent and not performed a move or up yet.

(onShowPress用户已执行了onShowPress的下移,但尚未执行上移或上移。)

This event is commonly used to provide visual feedback to the user to let them know that their action has been recognized ie highlight an element.

(此事件通常用于向用户提供视觉反馈,以使他们知道其动作已被识别,即突出显示元素。)

I tried both with a button and used a Toast to indicate that showPress and longPress happened.

(我有一个按钮尝试都和使用Toast ,表明showPresslongPress发生。)

However, I don't see any difference.

(但是,我看不出任何区别。)

What's the difference between onLongPress and onShowPress ?

(onLongPressonShowPress什么onShowPress ?)

What are some examples when we override GestureDetector for those MotionEvents ?

(什么是一些例子,当我们override GestureDetector那些MotionEvents ?)

  ask by Richard translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...