gesture-recognition

Intercepting/Hijacking iPhone Touch Events for MKMapView

流过昼夜 提交于 2019-12-17 09:15:10
问题 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

How to detect Swipe Gesture in iOS?

别说谁变了你拦得住时间么 提交于 2019-12-17 05:53:27
问题 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? 回答1: 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. :) 回答2: If You know

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

六月ゝ 毕业季﹏ 提交于 2019-12-17 05:16:06
问题 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,

How to simulate a touch event in Android?

浪尽此生 提交于 2019-12-16 22:37:11
问题 How to simulate a touch event with Android while giving the X and Y coordinates manually? 回答1: Valentin Rocher's method works if you've extended your view, but if you're using an event listener, use this: view.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { Toast toast = Toast.makeText( getApplicationContext(), "View touched", Toast.LENGTH_LONG ); toast.show(); return true; } }); // Obtain MotionEvent object long downTime = SystemClock

Detect pinch zoom in Windows phone (7.1)

一个人想着一个人 提交于 2019-12-12 14:31:04
问题 According to Silverlight toolkit the Gesture listener is to be considered deprecated The Gesture Listener should be considered deprecated for all Windows Phone 7.1 SDK development. And no other suggestions are available. In the absence of gesture listener what is the best way to detect pinch/zoom gestures in WP7? 回答1: Take a look at this MSDN page. It is using the ManipulationDelta class to handle touch and resizing. 来源: https://stackoverflow.com/questions/8870755/detect-pinch-zoom-in-windows

iphone slide movement recognizer

試著忘記壹切 提交于 2019-12-11 14:36:49
问题 I'm developing a new app and i need to implement a functionality used very often in many apps. I want to implement the functions "next page" / "previous page" with a sliding gesture respectively from left to right for the "next page" case and from right to left in the other. I've seen something about GestureRecognizer that maybe can help me, but unfortunately i'm developing under 3.1.2 firmware version and it's not supported yet. Any suggestion or link with any tutorial ? Thank you 回答1: To

How to detect Shake Gesture while application in Background?

﹥>﹥吖頭↗ 提交于 2019-12-11 07:29:35
问题 I'm currently working on a music player app, and like the iPod application, I would like to shuffle songs with shake gesture. I'm implementing motion methods like Apple recommends to, and in foreground everything works fine. - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event; - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event; - (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event; But I just can't figure out how to call those methods

how to make custom gestures in ios

爷,独闯天下 提交于 2019-12-11 03:53:52
问题 is it possible to make custom gestures in iOS such as a zigzag, or a other lines types? and can one link any action to a gesture. if you know an answer, or a link to an answer or exlanation, please share ... thanks 回答1: It is possible to create your own gesture recognizers. You can look at this section of the Event Handling Guide for iOS which gives information as to how you can build your own custom subclass. There are several examples on the net one of which is this. 来源: https:/

hand gesture recognition with camera video in actionscript

耗尽温柔 提交于 2019-12-11 02:14:43
问题 I want to implement an flex application using actionscript 3: with the camera and the virture buttons(like a image) in the camera, one can move his hand to pass over the virture button field in order to fire the button. Now my solution is following this way: capture the button field in erery frame to get a bitmapdata, and calculate the gray-scale summation of the bitmapdata, if the difference between the two frames is greater than a given value, then fire the button. Actually, it could work,

Image comparison using Objective C

一世执手 提交于 2019-12-11 01:09:17
问题 i am planning to create an application to compare pill images if they were the same. Is there any source that i could use that detects colors, shape, size of the pill in the picture and compre if that picture is the same with the other picture of the same pill? Regards, ZaldzBgz 回答1: I know a good library for computer vision, not sure if it can help you. You can look at: OpenCV. It worked with iPhone 来源: https://stackoverflow.com/questions/3474204/image-comparison-using-objective-c