当用户单击屏幕或打开键盘时,如何隐藏状态栏和导航栏?

编程入门 行业动态 更新时间:2024-10-26 00:19:59
本文介绍了当用户单击屏幕或打开键盘时,如何隐藏状态栏和导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个全屏的Flutter应用程序。 ,但问题是当用户触摸屏幕时,出现顶部状态栏,或者当用户触摸文本字段时,出现底部状态栏和顶部状态栏。

I have a flutter app that is fullscreen . but the problem is when user touches screen the Top Status Bar appears , or When user touches a textfield , the Bottom Status Bar and Top Status Bar appears .

如何预防此问题。

这是我制作Flutter应用程序的全屏代码:

Here is My Code For Make Flutter App fullscreen :

await SystemChrome.setPreferredOrientations( [DeviceOrientation.landscapeRight]); await SystemChrome.setEnabledSystemUIOverlays([]);

推荐答案

输出:

我不确定您在哪里使用该通话。这是最小的代码重现。

I'm not sure where are you using that call. Here is minimum code reproduction.

void main() => runApp(MaterialApp(home: HomePage())); class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { @override void initState() { super.initState(); SystemChrome.setEnabledSystemUIOverlays([]); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text("Full screen")), body: SizedBox.expand(child: FlutterLogo()), ); } }

更多推荐

当用户单击屏幕或打开键盘时,如何隐藏状态栏和导航栏?

本文发布于:2023-11-27 12:05:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638000.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   状态栏   屏幕   键盘   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!