class Home extends React.component {
static navigationOptios = {
title: "dddd",
headerStyle: {
backgroundColor: '#ff00ff',
},
headerTintColor: '#00ff00',
headerTitleStyle: {
backgroundColor: '#ff00ff',
},
header: ()=> <HeaderComponent/>,
headerTitle: ()=> <HeaderTitle/>,
headerLeft: ()=> <HeaderLeft/>,
headerRight: ()=> <HeaderRight/>,
}
}
Default navigationOptions setting
기본셋팅은 상위 stack 에서 관리한다.
const AppNavigator = createStackNavigator(
{
Home: HomeScreen,
Details: DetailsScreen,
},
{
initialRouteName: 'Home',
defaultNavigationOptions: {
headerStyle: {
backgroundColor: '#f4511e',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
}
}
}
);