Flutter WebView插件-启用缩放

时间:2019-12-05 13:11:39

标签: flutter

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

 @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,
    );
  }
}

1 个答案:

答案 0 :(得分:0)

尝试

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