Hello,
There is no API for long press in touch
events, so you could only use a timer to distinguish click
from long press
.
In addition, it is more recommended to use LongClick
event, if you only want to distinguish click
from long press
.
If you want to try this way, please refer to the following code:
public class LongClickLis : Java.Lang.Object, IOnLongClickListener
{
public bool OnLongClick(View v)
{
// handle long press event
return true; // add it to to distinguish `click` from `long press`.
}
}
// in the activities:
textView.Click += ShortOnClick;
textView.SetOnLongClickListener(longClickLis);
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.