New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AndroidView去加载webview无法显示 #37
Comments
@nightwolf-chen @Wanchen7 其实这个问题,我老早就提出来了,只是作者不愿意测试这个问题也不愿意解决,如果连最基本的WebView都不支持,开源还有什么意思??? |
@Wanchen7 |
@ruanchaohouzi 你尝试这样做:
1、在flutter端 写一个state的基类并且 with WidgetsBindingObserver 复写它的方法 前面写的原生端的代码可以去掉了。 |
只在webview页面使用这个BaseState不行啊,怎么使用的呢,每个页面都用? |
还是写个插件调用原生的WebView吧,,, |
老哥,太强了,我不是 webview 加载不了,我是有一个手机红米5加载各种 androidView 都出现不了,底层报 dialog 获取不到context。果然是flutterboost 的坑。用了这个方法,搞定 |
所以这个flutterboost 调用原生的webview 怎么解决呢 |
场景:
flutter端 从 A页面跳转到B页面 并且销毁A页面,在B页面通过androidview 加载一个原生的webview页面。但是无法显示出来。
初步定位:
1、flutterview 是单例,所以FlutterPluginRegistry的attach的时候,context是A页面的。
2、在PlatformViewFactory 的create 方法里面 context是SingleViewPresentation持有的,也就是A页面的context。但是A已经销毁了,所以显示不出来。
问题:有些手机是android 9.0的可以显示出来的,但是我手头上的一个pad是7.0的就无法显示。
这个有解吗?
The text was updated successfully, but these errors were encountered: