React native 无法更改react本机项目中的默认主题react导航主题
我在做一个项目。出于导航目的,我使用“反应导航”。但是,我需要更改react导航库的默认主题样式。为了做到这一点,我写了下面的代码,但它不起作用。请帮我做这个React native 无法更改react本机项目中的默认主题react导航主题,react-native,react-navigation,react-navigation-stack,react-navigation-v5,react-navigation-bottom-tab,React Native,React Navigation,React Navigation Stack,React Navigation V5,React Navigation Bottom Tab,我在做一个项目。出于导航目的,我使用“反应导航”。但是,我需要更改react导航库的默认主题样式。为了做到这一点,我写了下面的代码,但它不起作用。请帮我做这个 // customize theme const MyTheme = { ...DefaultTheme, colors: { ...DefaultTheme.colors, primary: "rgb(255, 45, 85)", }, }; // Navigation containe
// customize theme
const MyTheme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: "rgb(255, 45, 85)",
},
};
// Navigation container
export default function App() {
console.log(MyTheme);
return (
<NavigationContainer theme={MyTheme}>
<AuthNavigator />
</NavigationContainer>
);
}
// import navigation container and default theme
import { NavigationContainer, DefaultTheme } from "@react-navigation/native";