0
I’m having trouble positioning a component
of tabbar
what I’m doing.
Home js.
import React, {Component} from 'react'
import {View, Text, ScrollView} from 'react-native'
import Header from './../components/Header'
import Card from './../components/Card'
import TabBar from './../components/TabBar'
class Home extends Component{
render(){
const {scrollContent, tab, scroll} = styles
return(
<View>
<Header />
<View>
<ScrollView>
<Card />
</ScrollView>
</View>
<TabBar />
</View>
)
}
}
export default Home
Tabbar.js
import React from 'react'
import {View, Text} from 'react-native'
const TabBar = () => {
const {tab} = styles
return(
<View style={tab}>
</View>
)
}
const styles = {
tab: {
height: 50,
backgroundColor: '#000',
position: 'absolute',
bottom: 0,
flexDirection: 'row'
}
}
export default TabBar
If I leave with the position: 'absolute'
, it disappears from the screen, if I shoot, it gets down from my Component card
.
The idea is that it stays at the bottom of the screen, fixed.
When setting the position Absolute the width loses the reference, so I think just add a width 100% and take the flexDirection that has no use there, if it doesn’t work the problem is in the container.
– Felipe Duarte
@Felipeduarte I did what I said and is still missing :/ the container has no style defined
– Rafael Augusto
But where does it go? , can inspect and show the structure already compiled in the browser?
– Felipe Duarte
@Felipeduarte Cara, I got it, thanks even in, Voce spoke of
container
then went and put oncontainer: {height: '100%'}
and then stayed there at the end.– Rafael Augusto
Then yes haha, I answered to be more organized.
– Felipe Duarte