如何将这三个盒子相互堆叠?
我尝试设置所有这些设置,但没有帮助
justifyContent: 'center', alignContent: 'center',alignSelf: 'center'
代码:
import React, { Component } from 'react';
import { AppRegistry, View } from 'react-native';
export default class FlexDirectionBasics extends Component {
render() {
return (
// Try setting `flexDirection` to `column`.
<View style={{ flex: 1, flexDirection: 'row' ,alignItems: 'center' ,
justifyContent: 'center', alignContent: 'center',alignSelf: 'center'}}>
<View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</View>
);
}
};
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => FlexDirectionBasics);