Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在webview中,尝试嵌入平台视图时出现如下错误,但PaintContext不支持嵌入_Ios_Flutter_Webview_Wkwebview - Fatal编程技术网

Ios 在webview中,尝试嵌入平台视图时出现如下错误,但PaintContext不支持嵌入

Ios 在webview中,尝试嵌入平台视图时出现如下错误,但PaintContext不支持嵌入,ios,flutter,webview,wkwebview,Ios,Flutter,Webview,Wkwebview,在my info.plist文件中添加了密钥 io.flatter.embedded\u视图\u预览=是 在webview中加载base 64转换的html字符串。它在室内工作得很好 安卓,但iOS,我在上面提到的问题上出错了 String htmlText=getHTML(cp); 最终字符串contentBase64=base64Encode(const Utf8Encoder().convert(htmlText)); 字符串url='数据:text/html;base64,$conten

在my info.plist文件中添加了密钥 io.flatter.embedded\u视图\u预览=是

在webview中加载base 64转换的html字符串。它在室内工作得很好 安卓,但iOS,我在上面提到的问题上出错了

String htmlText=getHTML(cp);
最终字符串contentBase64=base64Encode(const Utf8Encoder().convert(htmlText));
字符串url='数据:text/html;base64,$contentBase64';
this.child=WebView(
initialUrl:url,
javascriptMode:javascriptMode.unrestricted,
JavaScriptChannel:[
_cpJavascriptChannel(buildContext,cp),
].toSet(),
onWebViewCreated:(WebViewController WebViewController){
_控制器。完成(webViewController);
},
navigationDelegate:(NavigationRequest请求){返回NavigationDecision.prevent;}
);
JavascriptChannel\u cpJavascriptChannel(构建上下文上下文,chargePoints.ChargePoint cp){
返回JavascriptChannel(
名称:“充电桩”,
onMessageReceived:(JavascriptMessage消息){
Navigator.of(buildContext.pushReplacementNamed(“/chargePoint”,参数:{'cp':cp,'connector':message.message});
});
}

以下是帮助我解决此问题的代码

<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
io.flatter.embedded\u视图\u预览
NSAllowsArbilarLoadsInWebContent
您还可以从中阅读有关新更改的更多信息

<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>