首页 > 解决方案 > react-navigation 如何设置背景颜色

问题描述

如何在此图像中使角度变黑?

我想在导航标题上扩展黑色背景

    <NavigationContainer>
      <Stack.Navigator
      screenOptions={{
        headerTitleAlign: 'center',
        activeTintColor: 'purple',
        inactiveTintColor: 'gray',
        headerTintColor: '#fff',
        headerStyle: {
          backgroundColor: 'rgba(128, 0, 128, 10)',
          borderBottomLeftRadius: 13,
          borderBottomRightRadius: 13,
        }}}>
        <Stack.Screen
        options={{headerShown: false}}
        name='Main' component={MainTab}/>
        <Stack.Screen name='Photo' component={PhotoScreen}/>
      </Stack.Navigator>
    </NavigationContainer>

标签: react-native

解决方案


推荐阅读