ios Titanium SDK 8.2.0GA放大WebView不工作

evrscar2  于 2023-10-21  发布在  iOS
关注(0)|答案(1)|浏览(125)

我们正在将现有的Titanium经典应用程序迁移到Titanium SDK 8.2.0GA以及更高版本。我们遇到的问题,在激活缩放/捏缩放功能在iOS WebViews与加载的html页面。我们假设问题是由于UiWebView与WKWebView的兼容性,但我们无法看到我们必须应用设置以重新启用缩放功能。html页面,包括js和其他应用程序在8.2.0GA上工作起来很有魅力。
谢谢你的建议。

  1. 'Viewport setting works perfect in SDK 7.4.0 but does not zoom in SDK 8.2.0GA
  2. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=10.0, user-scalable=yes"/>
  3. 'This is an example webview we use
  4. var webView = Ti.UI.createWebView({
  5. left : gutter,
  6. top : gutter,
  7. right : gutter,
  8. bottom : gutter,
  9. // This allows the translucent view and the background to shine through. You could set this to a standard RGB color and change the opacity if desired.
  10. backgroundColor : translucentViewOn ? 'transparent' : backgroundColor,
  11. opacity : animationsOn ? 0 : 1,
  12. enableZoomControls : true, // Android only
  13. // Default assumes that all HTML is in the HTML folder and the first file is index.html, you can change the next line to suit your HTML.
  14. url : '/HTML/index.html'
  15. });
a64a0gku

a64a0gku1#

万一别人也需要缩放。我们找到了正确的设置:

  1. var webView = Ti.UI.createWebView({
  2. url: href,
  3. backgroundColor: "transparent", //not relevant for zooming
  4. borderWidth: 1, //not relevant for zooming
  5. scalesPageToFit: false,
  6. willHandleTouches: false,
  7. disableZoom: false
  8. });
  9. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes"/>

相关问题