Я пытаюсь установить tabBarNavigation поверх фона изображения, чтобы я мог видеть фон изображения через tabBar.Если я установлю position
на absolute
, я смогу увидеть фоновое изображение, но текст и tabBar отсутствуют.Это мой код:
export default class App extends Component {
render(){
return(
<SafeAreaView style={{flex:1}}>
<AppContainer/>
</SafeAreaView>
)
}
}
class HomeScreen extends Component {
render(){
return(
<View>
<ImageBackground
style={{width:375, height:400}}
source={require('./assets/pizza.jpg')}>
</ImageBackground>
</View>
)
}
}
const AppTabNavigator = createMaterialTopTabNavigator({
Home:{
screen:HomeScreen,
navigationOptions: {
header: null,
tabBarVisible:true,
activeTintColor: '#e91e63',
}
},
Second:{
screen: Second,
navigationOptions: {
header: null,
tabBarVisible:true,
}
},
Third:{
screen: Third,
navigationOptions: {
header: null,
tabBarVisible:true,
}
},
Fourth:{
screen: Fourth,
navigationOptions: {
header: null,
tabBarVisible:true,
}
}
}, {
tabBarOptions: {
style: {
backgroundColor: 'gray',
//If I set position to absolute, I can see background image but text is missing
position:'absolute'
}
}
}
)
const AppContainer = createAppContainer(AppTabNavigator)
![enter image description here](https://i.stack.imgur.com/LO2jJ.png)
Любые комментарии или советы будут очень благодарны!Заранее спасибо:)