Webview 颤振:如何在web视图中启用手势?
我想在Flatter中缩进和缩进以放大我的web视图页面。 我在网上做了一些研究,我在某个地方发现了: 尽管收缩和缩放内置于WebView(Android)和UIWebView(iOS)中,但它们需要“打开”。 在Android中,插件需要调用以下命令:Webview 颤振:如何在web视图中启用手势?,webview,flutter,zooming,gestures,Webview,Flutter,Zooming,Gestures,我想在Flatter中缩进和缩进以放大我的web视图页面。 我在网上做了一些研究,我在某个地方发现了: 尽管收缩和缩放内置于WebView(Android)和UIWebView(iOS)中,但它们需要“打开”。 在Android中,插件需要调用以下命令: this.webView.getSettings().setBuiltInZoomControls(true); this.webView.getSettings().setSupportZoom(true); to allow pinch/z
this.webView.getSettings().setBuiltInZoomControls(true);
this.webView.getSettings().setSupportZoom(true); to allow pinch/zoom.
self.webview.scalesPageToFit = YES; to allow pinch/zoom."
在iOS中,插件需要调用以下命令:
this.webView.getSettings().setBuiltInZoomControls(true);
this.webView.getSettings().setSupportZoom(true); to allow pinch/zoom.
self.webview.scalesPageToFit = YES; to allow pinch/zoom."
问题是我不知道把代码放在哪里/我不知道如何使用它。
有人能帮我吗?将缩放方法放在webview声明之后,请参考下面的代码
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.show_web_view);
webView = (WebView) findViewById(R.id.webView1);
WebSettings webSettings = webView.getSettings();
webSettings.setBuiltInZoomControls(true);
webSettings.setSupportZoom(true);
}
如果Android部分不起作用,那么应该在那里创建一个新的问题,或者更好地创建一个拉请求。我发现,如果启用缩放,不仅可以使用这些按钮进行缩放,还可以使用手势(收缩和收缩)。现在的问题是:有没有办法删除这些按钮,以便只使用收缩/收缩?