Questions tagged [long-press]

if the user keeps pressing the button for some time, a different action is executed from the short press action.

308 questions
196
votes
10 answers

Long press on UITableView

I would like to handle a long press on a UITableViewCell to print a "quick access menu". Did someone already do this? Particularly the gesture recognize on UITableView?
foOg
  • 3,126
  • 3
  • 19
  • 18
89
votes
9 answers

UIButton Long Press Event

I want to emulate a long a press button, how can I do this? I think a timer is needed. I see UILongPressGestureRecognizer but how can I utilize this type?
Andrea
  • 1,597
  • 3
  • 18
  • 24
68
votes
9 answers

Detect touch press vs long press vs movement?

I'm currently fiddling around with Android programming, but I have a small problem detecting different touch events, namely a normal touch press (press on the screen and release right away), a long press (touch the screen and hold the finger on it)…
user504451
59
votes
13 answers

SwiftUI: how to handle BOTH tap & long press of button?

I have a button in SwiftUI and I would like to be able to have a different action for "tap button" (normal click/tap) and "long press". Is that possible in SwiftUI? Here is the simple code for the button I have now (handles only the "normal"…
Gerard
  • 1,807
  • 4
  • 13
  • 20
49
votes
4 answers

Swift: Long Press Gesture Recognizer - Detect taps and Long Press

I want to wire an action such that if the gesture is a tap, it does animates an object in a particular way but if the press duration was more than .5 secs it does something else. Right now, I just have the animation hooked up. I don't know how I can…
blue_zinc
  • 2,410
  • 4
  • 30
  • 38
27
votes
6 answers

Using long press gesture to reorder cells in tableview?

I want to be able to reorder tableview cells using a longPress gesture (not with the standard reorder controls). After the longPress is recognized I want the tableView to essentially enter 'edit mode' and then reorder as if I was using the reorder…
Michael Campsall
  • 4,325
  • 11
  • 37
  • 52
22
votes
5 answers

iPhone iOS how to add a UILongPressGestureRecognizer and UITapGestureRecognizer to the same control and prevent conflict?

I'm building an iPhone app that would let the user rearrange some of the UI elements on the screen. How can I add a tap gesture recognizer and a long press gesture recognizer to the same UIView? When I lift up the finger from the long press, the…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
18
votes
9 answers

Hiding of the Toast for long press on actionBar item

Is some possible way how to hide the toast after long-press on the ActionBar item? I didn't setup a title for the item but it is still there - empty toast.
AdaMoOo
  • 427
  • 2
  • 5
  • 12
12
votes
4 answers

On Android, is there any way to disable a Spinner's long-press behavior?

The default spinner behavior is that when it's "closed", longpressing on it will "open" it and show you the dropdown view. I find this behavior to be potentially very problematic for the user. For example, if they're trying to scroll something on…
user496854
  • 6,461
  • 10
  • 47
  • 84
11
votes
1 answer

Android - Is It possible to disable the long click of home button to avoid the task manager?

I am looking for a way to disable the task manager window once I long press on the home button. I managed to disable other device keys (such as volume, menu etc) and the normal click on the home button as I am the default launcher, but I don't know…
Amir
  • 153
  • 1
  • 1
  • 9
10
votes
4 answers

How to differentiate between long key press and regular key press?

I'm trying to override the functionality of the back key press. When the user presses it once, I want it to come back to the previous screen. However, when the back key is long-pressed (for, let's say, two seconds or more), I want to exit the…
Mister Smith
  • 27,417
  • 21
  • 110
  • 193
10
votes
5 answers

Tap and Hold (Long Press)

Has anyone implemented Tap & Hold in a Windows Phone 7 App yet? I can see a couple of possible approaches KeyDown/KeyUp and a timer or ManipulationStarted/manipulationCompleted and a timer. However it strikes me that this is a less than idea…
David Hayes
  • 7,402
  • 14
  • 50
  • 62
9
votes
4 answers

disable the intent filter from android manifest programmatically

In my activity I have a web view and in manifest.xml I have declared intent filter like this
9
votes
3 answers

WKWebView : How to change Long press action or disable it?

Hi everyone (why my greeting message is always deleted ??? !!! ) Even I read many topics about it, I didn't find a proper answer about my issue. I would like to know if it's possible to disable a long press event on a wkwebview window or detect…
Sam
  • 283
  • 3
  • 12
8
votes
2 answers

long press on selected text in textview in android

In my android app, I have a text view and some text in it. I want that user can see the meaning of the words in a tool tip box when he long press on the word . My problem is that I don’t know how to implement long press in the words.Can some body…
user2586307
1
2 3
20 21