刚创建的Expo项目中StatusBar不显示的问题求助
Expo新项目中StatusBar不显示问题
我刚创建了一个Expo项目,旧版本里从没遇到过这种问题。只执行了两条命令:
npx create-expo-app@latestnpm run reset-project
项目里只有一个文件index.js,我已经在网上搜了4-5小时解决方案,但没找到能用的。
截图:
我试过这些操作:检查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
相关产品推荐
相关产品推荐

