网站https://app.seesaw.me/#/login不会在android网络视图中为我呈现任何内容。
我的设置如下:
with(webView.settings) {
mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
loadsImagesAutomatically = true
javaScriptEnabled = true
ResourcesCompat.getFont(requireContext(), R.font.helvetica_neue)
}
webView?.loadUrl("https://app.seesaw.me/#/login")
它会加载主页,但当我导航到登录时,屏幕会变为空白。logcat显示此消息。
D/InputMethodManager: HSIFW - flag : 0
I/chromium: [INFO:CONSOLE(18)] "Invalid asm.js: Type mismatch in assignment", source: https://app.seesaw.me /#/login?force_login=signup (18)
I/chromium: [INFO:CONSOLE(4)] "The provided value 'moz-chunked-arraybuffer' is not a valid enum value of type XMLHttpRequestResponseType.", source: (4)
I/chromium: [INFO:CONSOLE(14)] "Uncaught TypeError: Cannot read properties of null (reading 'getItem')", source: https://files.seesaw.me/release/prod/shared-ext.ec61797e71c5b625.bundle.js (14)
I/ViewRootImpl@7385979[MainActivity]: ViewPostIme pointer 0
嗨,试着在javaScriptEnabled = true
之后添加此行domStorageEnabled = true
,并告诉我它是否有效
请尝试下面的代码,因为我已经检查了您给定的URL,它可以很好地使用下面的代码:-
WebSettings settings = binding.wvTermsConditions.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setBuiltInZoomControls(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
binding.webView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
binding.webView.loadUrl(url);