gesture-recognition

Gesture problem: UISwipeGestureRecognizer + UISlider

不打扰是莪最后的温柔 提交于 2019-11-27 11:49:55
Got a gesture related problem. I implemented UISwipeGestureRecognizer to get swipe left and right events and that is working fine. However the problem I'm facing is that the UISlider's I have in the same view are not playing nice. The sliding motion of the sliders is being mistaken as a swipe left/right. Any one experienced this problem before, got any ideas how to correct it? Many thanks. Here is the code contained within the view controller: - (void)viewDidLoad { [super viewDidLoad]; //Setup handling of LEFT and RIGHT swipes UISwipeGestureRecognizer *recognizer; recognizer = [

How to do Gesture Recognition using Accelerometers

女生的网名这么多〃 提交于 2019-11-27 09:38:23
问题 My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend? The sun spot is a Java platform

Intercepting/Hijacking iPhone Touch Events for MKMapView

寵の児 提交于 2019-11-27 07:20:56
Is there a bug in the 3.0 SDK that disables real-time zooming and intercepting the zoom-in gesture for the MKMapView? I have some real simple code so I can detect tap events, but there are two problems: zoom-in gesture is always interpreted as a zoom-out none of the zoom gestures update the Map's view in realtime. In hitTest, if I return the "map" view, the MKMapView functionality works great, but I don't get the opportunity to intercept the events. Any ideas? MyMapView.h: @interface MyMapView : MKMapView { UIView *map; } MyMapView.m: - (id)initWithFrame:(CGRect)frame { if (![super

How to programmatically trigger the touch event in android?

做~自己de王妃 提交于 2019-11-27 03:55:45
I would like to trigger a touch event like this: First the finger is touch down at the (0,50%) of the screen and slide to the (50%,50%) of the screen, and exit (move the finger off the screen) I have found some thing like this: MotionEvent event = MotionEvent.obtain(downTime, eventTime, action, x, y, pressure, size, metaState, xPrecision, yPrecision, deviceId, edgeFlags); onTouchEvent(event); However, how to emulate the above case? Do I need to create 2 event ? onTouchDown , onMove etc.... ? Thanks for helping. bstar55 // Obtain MotionEvent object long downTime = SystemClock.uptimeMillis();

How to detect doubletap on a View? [duplicate]

元气小坏坏 提交于 2019-11-27 02:44:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Android - basic gesture detection I'm trying to have a View sensitive to double taps on an Android. So far, I learned to set up the double tap and know what place to handle the event for action: API: android.view.GestureDetector.OnDoubleTapListener private GestureDetector mGestureDetector; … mGestureDetector = new GestureDetector(this); … mGestureDetector.setOnDoubleTapListener(new MyDoubleTapListener()); …

How to correctly subclass UIGestureRecognizer

谁说胖子不能爱 提交于 2019-11-26 23:18:11
问题 I have gone through the documentation: https://web.archive.org/web/20130309051214/http://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizer_basics/GestureRecognizer_basics.html#//apple_ref/doc/uid/TP40009541-CH2-SW2 I am trying to implement the check mark example shown in the documentation and I can't because the compiler shows a bunch of warnings about the [super touchesMoved:touches withEvent:event] call, which is recommended by

How to have a UISwipeGestureRecognizer AND UIPanGestureRecognizer work on the same view

坚强是说给别人听的谎言 提交于 2019-11-26 22:40:10
问题 How would you setup the gesture recognizers so that you could have a UISwipeGestureRecognizer and a UIPanGestureRecognizer work at the same time? Such that if you touch and move quickly (quick swipe) it detects the gesture as a swipe but if you touch then move (short delay between touch & move) it detects it as a pan? I've tried various permutations of requireGestureRecognizerToFail and that didn't help exactly, it made it so that if the SwipeGesture was left then my pan gesture would work up

How to detect Swipe Gesture in iOS?

痞子三分冷 提交于 2019-11-26 22:08:08
In my iPhone app, I require to recognize the swipe gesture made by the user on the view. I want the swipe gestures to be recognized and perform a function on swipe. I need that the view should horizontally slide and show another view as a user makes a swipe gesture. What needs to be done? How do I recognize it? Use the UISwipeGestureRecognizer . Not much else to say really, gesture recognizers are easy. There are WWDC10 videos on the subject even. Sessions 120 and 121. :) If You know how it works, but still need a quick example, here it is! (it will become handy at least for me, when I will

What is the difference between Pan and Swipe in iOS?

孤街浪徒 提交于 2019-11-26 21:33:43
Sounds simple .. Hold the Trackpad, move the finger, release .. But somehow swipe is not being triggered (pan is triggered instead) UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:v action:@selector(handleSwipe:)]; swipeGesture.direction= UISwipeGestureRecognizerDirectionUp; [v addGestureRecognizer:swipeGesture]; Pan is recognized by the above sequence instead. UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:v action:@selector(handlePan:)]; [v addGestureRecognizer: panGesture]; If pan is commented, swipe is

In iOS, how to drag down to dismiss a modal?

僤鯓⒐⒋嵵緔 提交于 2019-11-26 21:09:37
A common way to dismiss a modal is to swipe down - How do we allows the user to drag the modal down, if it's far enough, the modal's dismissed, otherwise it animates back to the original position? For example, we can find this used on the Twitter app's photo views, or Snapchat's "discover" mode. Similar threads point out that we can use a UISwipeGestureRecognizer and [self dismissViewControllerAnimated...] to dismiss a modal VC when a user swipes down. But this only handles a single swipe, not letting the user drag the modal around. Robert Chen I just created a tutorial for interactively