Flutter WebView插件-启用缩放 [英] Flutter webview plugin - enable pinch zoom

查看:198
本文介绍了Flutter WebView插件-启用缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的人.我可以使用Flutter WebView插件创建Web视图.但我无法缩放(缩小)网站.有什么解决办法吗?

i am new to flutter. I could able to create a web view using flutter webview plugin. but I could not able to zoom(pinch zoom ) the website. any solution to this?

 @override
  Widget build(BuildContext context) {
    return WebviewScaffold(
      appBar: AppBar(

        title: Text("Hi"),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.camera_alt),


            onPressed: () => scanbarcode(),
          ),
          SizedBox(width: 50,),
          IconButton(
            icon: Icon(Icons.home,color: Colors.white,),
            onPressed: (){
              flutterWebviewPlugin.reloadUrl("http://www.google.com");
            },
          ),

        ],
      ),
      url: urlString,
      withZoom: true,
      withJavascript: true,
    );
  }
}

推荐答案

尝试一下

this.webView.getSettings().setBuiltInZoomControls(true);
this.webView.getSettings().setSupportZoom(true);

这篇关于Flutter WebView插件-启用缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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