【问题标题】:Flutter webview plugin - enable pinch zoomFlutter webview 插件 - 启用捏缩放
【发布时间】:2020-03-30 10:24:25
【问题描述】:

我是新来的颤振。我可以使用颤振 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,
    );
  }
}

【问题讨论】:

    标签: flutter


    【解决方案1】:

    试试这个

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

    【讨论】:

      猜你喜欢
      • 2011-10-30
      • 2017-10-28
      • 1970-01-01
      • 1970-01-01
      • 2020-05-09
      • 1970-01-01
      • 2011-06-28
      • 2011-11-18
      • 2016-02-10
      相关资源
      最近更新 更多