×

HELLO, MY
NAME IS MARTIN
AND THIS IS
MY BLOG

Titanium module for zooming & scrolling webviews

Posted on

A few days ago I stumbled over a stackoverflow question. It was about how to set/reset the zoom level of a webview programmatically in Titanium. Although I never needed it before, I thought this was a pretty common thing to do. However, after looking through the docs of both Apple and Titanium, it was clear that such a thing did not exist.

For native iOS, there were a few workarounds, but none of them would apply to Titanium. So I decided to write a module, a simple wrapper of the Ti.UI.WebView.

It adds two simple methods to the WebView: setZoomLevel() and scrollToTop()

So if you feel the need to set the zoom level of a WebView or Scroll to top with these two magical methods, you can find them here https://github.com/mwfire/titanium-module-extended-webview

Update

As of today, the supported methods by V0.2 are:
setZoomScale() scrollTo() scrollToTop() scrollToBottom()