NativeScript:如何取消WebView中的缩放控件? [英] NativeScript: How do I disble zoom controls in WebView?

查看:85
本文介绍了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天全站免登陆