从React Native Android应用中删除系统菜单栏 [英] Remove system menu bar from react native android app

查看:121
本文介绍了从React Native Android应用中删除系统菜单栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单,我一直无法找到解决方案.菜单栏在我的应用程序中非常烦人,我希望有一种方法可以将其删除.

My problem is simple and I have been unable to find a solution. The menu bar is very annoying in my app and I am hoping that there is a way to remove it.

推荐答案

查看 Hiding the Navigation Bar 我发现了这一点:

Looking at Hiding the Navigation Bar I found this:

您可以使用SYSTEM_UI_FLAG_HIDE_NAVIGATION标志在Android 4.0及更高版本上隐藏导航栏.此代码段同时隐藏了导航栏和状态栏:

You can hide the navigation bar on Android 4.0 and higher using the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag. This snippet hides both the navigation bar and the status bar:

View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
          | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

我不知道这是否正是您想要的,但是您可以对其进行测试.

I do not know if that's exactly what you was looking for, but you can test it.

这篇关于从React Native Android应用中删除系统菜单栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆