【发布时间】:2022-12-11 06:05:55
【问题描述】:
大家好我有全屏问题我尝试了各种设置但我无法在 android 12 api31 上获得全屏。
目前我是这样设置的。
我这样运行应用程序
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []).then(
(_) => runApp(MyApp()),
);
在 styles.xml 中
<style name="NormalTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
// Important to draw behind cutouts
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
在 AndroidManifest.xml 中
android:windowSoftInputMode="adjustResize"
我也尝试过其他东西,但目前我得到的最好结果是这个
return Scaffold(
body: Container(
color: Colors.deepPurple,
child: const Center(
child: Text(
"Container full",
style: TextStyle(fontSize: 40),
),
),
),
);
我想覆盖整个屏幕,但我什至无法覆盖缺口
最后的结果应该是这样的。 我希望能够为我的应用操纵整个屏幕空间。 我不要系统吧。
【问题讨论】:
-
你到底想做什么?你能提供更多的说明吗?
-
我想要一个完整的屏幕,目前我有一个黑色空间,正如你在照片中看到的那样
-
你想覆盖整个屏幕吗?
-
是的,我希望整个屏幕都能使用
-
然后拿一个 Container 并用 MediaQuery.of(context).size.width 添加它的 width 属性。
标签: android flutter dart android-12 android-api-31