ios - Why does the status bar in my React Native app still appear black even after using SafeAreaView and expo-status-bar? - Sta

I’m building a React Native app using Expo and have been trying to customize the status bar color, but

I’m building a React Native app using Expo and have been trying to customize the status bar color, but it still shows as black on the top and bottom of the screen.

I am testing the app through the Expo Go app on iOS.

Screen

Here’s the code I’m using:

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context';

export default function App() {
  return (
    <SafeAreaProvider>
      <SafeAreaView style={styles.container}>
        <Text style={styles.text}>Notice that the status bar has light text!  </Text>
      </SafeAreaView>
    </SafeAreaProvider>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'grey',
    alignItems: 'center',
    justifyContent: 'center',
  },
  text: {
    color: '#000',
  },});

I’ve also tried changing the background color and style in StatusBar, but the status bar is still black.

I want the status bar to match the background color of the SafeAreaView (grey).

Thanks!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745173923a4615093.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信