Commit 10cdfeb3 authored by justin's avatar justin

Fix flutter测获取屏幕宽度为0的问题

parent 67a11880
...@@ -802,6 +802,7 @@ public class XFlutterView extends FrameLayout { ...@@ -802,6 +802,7 @@ public class XFlutterView extends FrameLayout {
+ "FlutterView was not attached to a FlutterEngine."); + "FlutterView was not attached to a FlutterEngine.");
return; return;
} }
if(viewportMetrics.width==0&&viewportMetrics.height==0)return;
viewportMetrics.devicePixelRatio = getResources().getDisplayMetrics().density; viewportMetrics.devicePixelRatio = getResources().getDisplayMetrics().density;
flutterEngine.getRenderer().setViewportMetrics(viewportMetrics); flutterEngine.getRenderer().setViewportMetrics(viewportMetrics);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment