【发布时间】:2018-09-01 07:03:16
【问题描述】:
我正在使用标签导航来上传如下图片
const Photos = TabNavigator({
CAMERA: {
screen: TakeCamera,
navigationOptions: {
tabBarIcon: ({focused}) => (
<View style={{flexDirection: 'row'}}>
<Text style={{textAlign: 'center', color: focused? '#C7A985' : '#020202'}}>CAMERA</Text>
<Icon name="chevron-down" size={15} color= {focused? '#C7A985' : '#ffffff'}/>
</View>
)
},
},
ALBUMS: {
screen: Albums,
navigationOptions: {
tabBarIcon: ({focused}) => (
<View style={{flexDirection: 'row'}}>
<Text style={{textAlign: 'center', color: focused? '#C7A985' : '#020202'}}>ALBUMS</Text>
<Icon name="chevron-down" size={15} color= {focused? '#C7A985' : '#ffffff'}/>
</View>
)
},
},
{
tabBarOptions: {
upperCaseLabel: false,
showIcon: true,
showLabel: false,
style: {
backgroundColor: '#F7F1ED',
borderTopWidth: 1
}
},
//initialRouteName: 'Feed',
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false,
});
export default class UploadPost extends Component {
static navigationOptions = ({ navigation }) => ({
header: null,
tabBarVisible: false
});
render() {
return (
<View style={{flex: 1}}>
<StatusBar hidden={true}/>
<Photos screenProps={{navigation: this.props.navigation}}/>
</View>
);
}
}
这里<Statusbar hidden={true}> 按预期隐藏了“CAMERA”、“ALBUMS”屏幕中的状态栏。但它也会隐藏其他屏幕中的状态栏。
- 当我打开应用程序时,我可以看到状态栏
- 在我打开 CAMERA 或 ALBUMS 屏幕后,状态栏对于所有其他屏幕将永久隐藏。
我的问题是,如何仅在 CAMERA、ALBUMS 屏幕上隐藏状态栏?
【问题讨论】:
标签: react-native react-native-navigation