如何在本机上创建this布局?你能举个例子吗?我不明白如何创造它,因为这里的css很差。
答案 0 :(得分:0)
https://rnplay.org/apps/W0vWoQ
其中一个主要概念是布局的Flexbox,所以我会看一下。 Here是样式的全面概述。
var SampleApp = React.createClass({
render: function() {
return (
<View style={styles.container}>
<View style={styles.one}><Text style={styles.logo}>Text Logo</Text></View>
<View style={styles.two}></View>
<View style={styles.three}>
<Text>Some Texxt</Text>
</View>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
},
logo: {
color: 'white'
},
one: {
flex:2,
backgroundColor: 'black'
},
two: {
flex:7,
backgroundColor: 'white'
},
three: {
flex: 1,
backgroundColor: 'white',
borderTopWidth:4,
}
});