You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

刚创建的Expo项目中StatusBar不显示的问题求助

Expo新项目中StatusBar不显示问题

我刚创建了一个Expo项目,旧版本里从没遇到过这种问题。只执行了两条命令:

  • npx create-expo-app@latest
  • npm run reset-project

项目里只有一个文件index.js,我已经在网上搜了4-5小时解决方案,但没找到能用的。

截图:
StatusBar不显示截图

我试过这些操作:检查app.json,尝试用Expo StatusBar和React Native StatusBar,更新了手机上的Expo Go,把StatusBar放到View、SafeAreaView里,还尝试给StatusBar设置样式,但完全搞不懂——明明没对项目做任何修改,StatusBar就是不显示。

我的代码如下:

import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

export default function Index() {
  return (
    <SafeAreaView>
      <StatusBar />
      <Text>
        Hello world!
      </Text>
    </SafeAreaView>
  );
}

内容的提问来源于stack exchange,提问作者Viktor Orgován

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 17:32:32