pinch

How get webview scale in Android 4

怎甘沉沦 提交于 2019-12-10 03:09:58
问题 WebView.getScale() is deprecated (but still usable) The recommended way to get scale for webview is to use WebViewClient.onScaleChanged() http://developer.android.com/reference/android/webkit/WebViewClient.html#onScaleChanged(android.webkit.WebView, float, float) I've added corresponding handler in my custom webview: public class CustomWebView extends WebView { public CustomWebView(Context context) { super(context); setWebViewClient(new WebViewClient() { @Override public void onScaleChanged

Osmdroid and Pinch

佐手、 提交于 2019-12-07 04:27:40
问题 I'm developing an app using osmdroid (3.0.8). When I zoom using two fingers in and out, the zoom starts from the center of the map, not from the middle of the two fingers (using MapView.setMultiTouchControls(true); ). I've tried to implement the pinch (pinch) but with bad results. I've read other similar questions but without finding a good solution. Note: I MUST use OSM, and not other solutions 回答1: Osmdroid 3.0.10 includes support for zooming at the location you pinched at. The samples also

“Pinch to Zoom” using AutoLayout

爱⌒轻易说出口 提交于 2019-12-06 08:58:36
问题 I have followed many "Pinch to Zoom" tutorials I found online, and have done reading on AutoLayout, but I can't get it to work in my project. My whole project uses AutoLayout, so I don't want to turn it off. I am loading a huge UIImage (EG: 5000px on long edge) into a UIImageView, and i'd like to be able to pinch to zoom and move around the zoomed in image. I've tried using UIImageView inside a UISrollView, but I couldn't get it to work properly. The closest I could get was some random

Pinch zoom in android 2.1

此生再无相见时 提交于 2019-12-05 14:04:00
Is there a way we can achieve Pinch zoom ability to the imageview? Following code works great! You just have to copy and paste: import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PointF; import android.os.Handler; import android.util.AttributeSet; import android.util.FloatMath; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.GestureDetector.SimpleOnGestureListener; public

Osmdroid and Pinch

末鹿安然 提交于 2019-12-05 11:16:29
I'm developing an app using osmdroid (3.0.8). When I zoom using two fingers in and out, the zoom starts from the center of the map, not from the middle of the two fingers (using MapView.setMultiTouchControls(true); ). I've tried to implement the pinch ( pinch ) but with bad results. I've read other similar questions but without finding a good solution. Note: I MUST use OSM, and not other solutions Osmdroid 3.0.10 includes support for zooming at the location you pinched at. The samples also include a two-finger rotation gesture overlay if that is something you are interested in trying. 来源:

is there a class to get the default picture viewer in an app?

久未见 提交于 2019-12-05 05:59:43
问题 I don't want to access the images on the iphone, I want to display an image from my app, but like you view pictures in the picture album of the iphone - with all the pinch and zoom controls and such. Is this possible? I thought there might (by chance) be some class like the AVMediaPlayer class that would do this? Thanks Tom 回答1: If you're targeting 4.0 or later you can use QLPreviewController: Include #import <QuickLook/QuickLook.h> in your class Here is how to create one: Class qlookclass =

Pinch to zoom with Hammer.js

本秂侑毒 提交于 2019-12-05 05:58:25
问题 I want a pinch to Zoom function for an image. I want it to zoom in the area where the fingers are. My index is only <div id="wrapper" style="-webkit-transform: translate3d(0,0,0);overflow: hidden;"> </div> And my script for zooming and scrolling is similar with this example. I have made a few changes to fit with my project My problem is in case 'transform': rotation = last_rotation + ev.gesture.rotation; scale = Math.max(1, Math.min(last_scale * ev.gesture.scale, 10)); break; How can I change

How get webview scale in Android 4

若如初见. 提交于 2019-12-05 03:45:10
WebView.getScale() is deprecated (but still usable) The recommended way to get scale for webview is to use WebViewClient.onScaleChanged() http://developer.android.com/reference/android/webkit/WebViewClient.html#onScaleChanged(android.webkit.WebView , float, float) I've added corresponding handler in my custom webview: public class CustomWebView extends WebView { public CustomWebView(Context context) { super(context); setWebViewClient(new WebViewClient() { @Override public void onScaleChanged(WebView view, float oldScale, float newScale) { super.onScaleChanged(view, oldScale, newScale);

Pinch Zoom in webview [Android]

丶灬走出姿态 提交于 2019-12-04 21:14:08
问题 On my website, which is loaded in the webview, there is a map. There are also java scripts that detects double tap for zoom, dragging etc. But is it possible to have a javascript that detects the use of pinch zoom ? there are several examples of it working on an iphone, and on my website there is a script for the pinch zoom but it is only working on iphone..... Is it possible to get it to work on Android ? Thanks 回答1: There's an open-source library called android-pinch that you can include in

Double-tap to zoom and pinch to zoom on ImageView in android

…衆ロ難τιáo~ 提交于 2019-12-04 12:15:53
问题 I was looking for iphone like tap and pinch zooming with android ImageView. Mike Ortiz have done some excellent work on TouchImageView to detect boundaries. His code can be found here. This code is missing only one thing, i.e., double-tap to zoom. Can anyone help add this feature to Mike Ortiz code? 回答1: Pinch Zoom on ImageView in Android with Orientation handling import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix;