最佳答案
我想把一个白色的酒吧,将采取所有的宽度在屏幕底部。为此,我考虑使用带有继承的 flexbox
参数的 absolute
定位。
With the following code it renders something like 这个.
这是我的代码:
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'
},
});
我是 CSS 样式的新手,并不是所有的属性都可以在 React-Natural 中找到。所以我很感激你的帮助,谢谢