使用 React Native 隐藏状态栏 [英] Hiding the status bar with React Native

查看:145
本文介绍了使用 React Native 隐藏状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 React Native 进行开发时,如何隐藏 iOS 或 Android 的状态栏?我已经导入了 StatusBar,但我相信还有 StatusBarIOS 和用于 Android 的 StatusBar.

How do you hide the status bar for iOS or Android when developing with React Native? I've imported StatusBar, but I believe there is also StatusBarIOS and a StatusBar for Android.

推荐答案

想出了如何隐藏状态栏.首先,StatusBarIOS 已已弃用,因此您需要导入 StatusBar 然后简单地在渲染顶部包含此代码片段:

Figured out how to hide the status bar. First of all, StatusBarIOS is deprecated so you need to import StatusBar and then simply include this code snippet at the top of your render:

<StatusBar hidden />

StatusBar 上反应原生文档

React Native Docs on StatusBar

这篇关于使用 React Native 隐藏状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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