Search code examples
androidioscordovaionic-frameworkinappbrowser

Changing initial zoom of InAppBrowser for iOS


Is there a way to scale the inital web view of InAppBrowser to a certain zoom percentage in Objective C for iOS development with the Ionic Framework? I was able to do it in the InAppBrowser.java class for Android with this line of code:

 inAppWebView.setInitialScale((int)(60 * inAppWebView.getScale()));

Here is the documentation for InAppBrowser.java (this line of code is added after line 897): https://github.com/apache/cordova-plugin-inappbrowser/blob/master/src/android/InAppBrowser.java


Solution

  • Have you tried using the viewport meta tag? It should set the initial zoom for all platforms according to its values as follows:

    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />