j.d*_*doe 5 reactjs react-native
我使用堆栈导航器导航到一个视图.新屏幕有不同的背景颜色#E9E9EF,我不知道它来自哪里.我发现这个颜色是在react-navigation/lib/views/CardStack/Card.js中设置的.我试图改变视图背景颜色,但它没有奏效
return (
<View style={{backgroundColor: '#F5FCFF'}}>
</View>
)
Run Code Online (Sandbox Code Playgroud)
我还尝试在StackNavigator中使用此代码更改卡片样式,颜色没有改变
Other: {
screen: AppOtherContainer,
cardStyle: {backgroundColor: 'red'},
navigationOptions: ({navigation}) => ({
title: navigation.state.params.title
})
}
Run Code Online (Sandbox Code Playgroud)
尝试添加tintColor到您的导航选项
static navigationOptions = {
title: navigation.state.params.title,
header: navigation => ({
titleStyle: {
color: '#FFFFFF'
},
tintColor: '#F5FCFF'
})
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3923 次 |
| 最近记录: |