import React,{Component} from 'react';
import {View,Text} from 'react-native';
export default class Demo13Component extends Component{
render(){
return (
<View>
<View style={{height:100,width:100,backgroundColor:'#eee',alignItems:'center'}}>
<Text>水平居中</Text>
</View>
<View style={{height:100,width:100,backgroundColor:'green',justifyContent:'center'}}>
<Text>垂直居中</Text>
</View>
<View style={{height:100,width:100,backgroundColor:'red',alignItems:'center',justifyContent:'center'}}>
<Text>水平垂直居中</Text>
</View>
</View>
)
}
}
react native 各种居中
最新推荐文章于 2020-05-20 18:00:38 发布