Me gustaría poner una barra blanca que ocuparía todo el ancho en la parte inferior de la pantalla. Para hacerlo, pensé en usar el absolute
posicionamiento con los flexbox
parámetros heredados .
Con el siguiente código, renderiza algo como esto .
Aquí está mi código:
var NavigationBar = React.createClass({
render: function() {
return(
<View style={navigationBarStyles.navigationBar}>
//Icon 1, Icon 2...
</View>
);
}
});
var Main = React.createClass({
render: function() {
return(
<View style={mainStyles.container}>
<NavigationBar />
</View>
);
}
});
var mainStyles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#456783',
}
});
var navigationBarStyles = StyleSheet.create({
navigationBar: {
backgroundColor: '#FFFFFF',
height: 30,
position: 'absolute',
flexDirection: 'row',
bottom: 0,
justifyContent: 'space-between'
},
});
Soy nuevo en el estilo en CSS y no todas las propiedades están disponibles en React-Native. Así que se agradece cualquier ayuda, gracias :)
fuente
height:100%
hacerlotop:0, bottom:0
.left:0, right:0
, y no debe agregartop:0
, si establecetop:0
ybottom:0
, se mostrará a pantalla completa.top:0
ybottom:0
trabajado como reemplazo de "altura: 100%", lleve a @Premasagarleft
,top
,right
ybotton
a 0 y funciona perfecto.