Hi, i have to use webview for html content display in android application, now my problem is i dont want any kind of event effect on it either its for zooming purpose or scrolling purpose,for that i have create webview as below: webViewhtml =Titanium.UI.createWebView({ top:0, right:5, scrollsToTop:false, showScrollbars:false, willHandleTouches: false, html:<html text content> touchEnabled: false, height:"840px", }); but still all touch events are called ..so kindly guide me for it thanks vilasini patel
1 Answer
I needed a WebView that had no zoom capability. But my requirements were a little different, because I did want the user to be able to scroll and tap on links.
I never could find a way to completely disable zoom on all platforms. It seems that some android phone manufacturers are modifying the core WebView library code to prevent zoom from being disabled; I've tried every combination of viewport settings and I've made liberal use of WebView.enableZoomControls: false. On some Samsung and HTC phones, no matter what I do, "pinch zoom" is still enabled.
So what I am saying is that even if you can get the WebView to ignore other touches, you'll probably never get it to ignore pinch zoom on all devices.
I have two ideas:
- put a transparent view on top of the WebView (add it to the same parent with left:0, right:0, top:0, bottom:0). It should get all touch events, and none should go through to the WebView
- use a WebView to render an image from your markup with the
toImage()method, and then display the resulting image
Your Answer
Think you can help? Login to answer this question!