NativeScript:如何在 WebView 中禁用缩放控件? [英] NativeScript: How do I disable zoom controls in WebView?

查看:68
本文介绍了NativeScript:如何在 WebView 中禁用缩放控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从以下问题中找到了在 Android WebView 中启用/禁用缩放控件的方法.

I found the way to enable/disable zoom controls in Android WebView from following question.

如何删除 Android webview 上的缩放按钮?

我正在使用 NativeScript,但在 NativeScript WebView 中没有看到类似的方法.有什么方法可以从 NativeScript 访问 Android WebView 的方法吗?或者,还有其他方法吗?

I'm using NativeScript and I don't see similar method in NativeScript WebView. Is there any way I can access the methods of Android WebView from NativeScript? Or, is there any other way?

谢谢.

推荐答案

您可以通过 WebView 的 android 属性获取实际的 android.所以你可以在加载的事件中使用类似的东西:

You can get hold of the actual android trough the android property of your WebView. So you can probably use something like that in the loaded event:

var webView = page.getViewById("webViewID");
if(webView.android) { // in IOS android will be undefined
  webView.android.getSettings().setBuiltInZoomControls(false);
}

这篇关于NativeScript:如何在 WebView 中禁用缩放控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆