React Navigation default background color

前端 未结 6 1271
春和景丽
春和景丽 2021-01-02 16:45

I\'m using react-navigation and stack-navigator to manage my screens.

Platforms I\'m using:

  • Android
  • React Native: 0.47.1
  • React Naviga
6条回答
  •  佛祖请我去吃肉
    2021-01-02 17:44

    This was really changed in latest React Navigation versions. See

    https://reactnavigation.org/docs/themes/

    For example

    import * as React from 'react';
    import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
    
    const MyTheme = {
      ...DefaultTheme,
      colors: {
        ...DefaultTheme.colors,
        background: 'red'
      },
    };
    
    export default function App() {
      return (
        {/* content */}
      );
    }
    

提交回复
热议问题