NativeScript:如何取消WebView中的缩放控件?
问题描述:
我从以下问题中找到了在Android WebView中启用/禁用缩放控件的方法.
I found the way to enable/disable zoom controls in Android WebView from following question.
我正在使用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);
}