HarmonyOS 鸿蒙Next inappwebview设置options后部分网页显示异常
HarmonyOS 鸿蒙Next inappwebview设置options后部分网页显示异常
进入demo后点击右下角浮窗进入webview测试页面
2 回复
请参考以下代码。
initialSettings: InAppWebViewSettings(
applicationNameForUserAgent: _ua,
transparentBackground: true,
allowUniversalAccessFromFileURLs: true,
useShouldOverrideUrlLoading: true,
useOnDownloadStart: true,
resourceCustomSchemes: ["font"],
verticalScrollBarEnabled: true,
useOnLoadResource: true,
allowFileAccessFromFileURLs: false,
mediaPlaybackRequiresUserGesture: false,
javaScriptEnabled: true,
javaScriptCanOpenWindowsAutomatically: true,
useShouldInterceptFetchRequest: true,
)
新的API用InAppWebViewSettings,老版本不建议用initialOptions
更多关于HarmonyOS 鸿蒙Next inappwebview设置options后部分网页显示异常的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html