<Scene key="scene2" component={ChallengeScreen}
navigationBarStyle={{opacity:0.3}}/>
但问题是整个导航栏(包括左右按钮)将继承不透明度。我建议只设置hidenavbar={true},并在场景组件中实现自定义导航栏。例如:场景2中的组件(ChallengeScreen)
render() {
const customNavbar = {
<View style={{position:'absolute', top:0, flexDirection:'row', justifyContent:'space-between', backgroundColor:'transparent', padding:10}}>
<TouchableOpacity>
<Text>Left Button</Text>
</TouchableOpacity>
<Text>Title</Text>
<TouchableOpacity>
<Text>Right Button</Text>
</TouchableOpacity>
</View>
}
return () {
<View style={{flex:1}}>
{customNavbar}
<View></View>
</View>
}
}