UIPinchGestureRecognizer position the pinched view between the two fingers

You can get the CGPoint of the midpoint between two fingers via the following code in the method handlingPinchGesture. CGPoint point = [sender locationInView:self]; My whole handlePinchGesture method is below. /* instance variables CGFloat lastScale; CGPoint lastPoint; */ – (void)handlePinchGesture:(UIPinchGestureRecognizer *)sender { if ([sender numberOfTouches] < 2) return; if (sender.state == UIGestureRecognizerStateBegan) { lastScale = … Read more

Disable or prevent multitouch in Activity

The easiest way I found to force single touch across an entire app is to set it using a theme: <style name=”MyTheme” parent=”@android:style/Theme.Holo.Light”> <item name=”android:windowEnableSplitTouch”>false</item> <item name=”android:splitMotionEvents”>false</item> </style> Manifest: <application android:label=”@string/app_name” android:theme=”@style/MyTheme” >

How to disable multitouch?

If you want only one button to respond to touches at a time, you need to set exclusiveTouch for that button, rather than for the parent view. Alternatively, you could disable the other buttons when a button gets the “Touch Down” event. Here’s an example of the latter, which worked better in my testing. Setting … Read more

Android: difference between ACTION_UP and ACTION_POINTER_UP

Start here if you haven’t read it already: http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html Android thinks about touch events in terms of gestures. A gesture in this sense includes all events from the first finger that touches the screen to the last finger that leaves the screen. A single gesture’s entire event sequence is always sent to the same view … Read more

enable/disable zoom in Android WebView

On API >= 11, you can use: wv.getSettings().setBuiltInZoomControls(true); wv.getSettings().setDisplayZoomControls(false); As per the SDK: public void setDisplayZoomControls (boolean enabled) Since: API Level 11 Sets whether the on screen zoom buttons are used. A combination of built in zoom controls enabled and on screen zoom controls disabled allows for pinch to zoom to work without the on … Read more