1.样式一:
export default class App extends Component<Props> {
render() {
return (
<View style={style.container}>
<View style={style.subBox}>
<Text style={style.text}>subBox1</Text>
</View>
<View style={style.subBox}>
<Text style={style.text}>subBox2</Text>
</View>
<View style={style.subBox}>
<Text style={style.text}>subBox3</Text>
</View>
</View>
);
}
}
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',//此处修改了
backgroundColor:'skyblue',
height:500
},
subBox:{
backgroundColor:"red"
}
})
2.样式二:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'row', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
3.样式三:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'flex-start', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
4.样式四:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'flex-end', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
5.样式五:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'center', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
6.样式六:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'row',//此处修改了
justifyContent:'center',
backgroundColor:'skyblue',
height:500
}
})
7.样式七:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',//此处修改了
justifyContent:'space-between', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
8.样式八:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around', //此处修改了
backgroundColor:'skyblue',
height:500
}
})
9.样式九:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around', //此处修改了
flexWrap:'wrap',//此处修改了
backgroundColor:'skyblue',
height:500
}
})
10.样式十:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around',
flexWrap:'wrap',
alignItems:'strentch',//此处修改了
backgroundColor:'skyblue',
height:500
}
})
11.样式十一:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around',
flexWrap:'wrap',
alignItems:'flex-start',//此处修改了
backgroundColor:'skyblue',
height:500
}
})
12.样式十二:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around',
flexWrap:'wrap',
alignItems:'flex-end',//此处修改了
backgroundColor:'skyblue',
height:500
}
})
13.样式十三:
const style = StyleSheet.create({
container:{
display:'flex',
flexDirection:'column',
justifyContent:'space-around',
flexWrap:'wrap',
alignItems:'center',//此处修改了
backgroundColor:'skyblue',
height:500
}
})