我正在尝试为我的Android模拟器样式化statusBar
,但它的深度和绿色有点过于浓重。如何设置高度?
render() {
const { navigationState, dispatch } = this.props;
return (
<View>
<StatusBar translucent backgroundColor="#000" />
<View style={styles.appBar} />
<View style={styles.content} />
<NavigationStack
navigation={addNavigationHelpers({
dispatch,
state: navigationState,
addListener
})}
/>
</View>
);
}
}
const STATUSBAR_HEIGHT = Platform.OS === "ios" ? 20 : StatusBar.currentHeight;
const APPBAR_HEIGHT = Platform.OS === "ios" ? 44 : 56;
const styles = StyleSheet.create({
container: {
flex: 1
},
statusBar: {
height: STATUSBAR_HEIGHT
},
appBar: {
backgroundColor: "#79B45D",
height: APPBAR_HEIGHT
},
content: {
flex: 1,
backgroundColor: "#33373B"
}
});