flexdirection =子视图中的行justifycontent任何在本机中不起作用的属性

时间:2018-11-30 13:38:14

标签: react-native react-native-android react-native-ios react-native-navigation

这是我的代码

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';


export default class Dashboard extends Component{
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.welcome}>
            <Text>Hello mom</Text>
            <Text>Hello Rajat</Text>
        </View>
        <View style={styles.instructions}>
            <Text>Hello Jon</Text>
            <Text>Hello BOB</Text>
        </View>         
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    flex:1,
    flexDirection:'column',
    alignItems:'flex-start',
    justifyContent:'space-around',
  },
  instructions: {
    flex:2,
    flexDirection:'row',
    //alignItems:'flex-end',
    //marginRight: 50,
    justifyContent:'flex-start',
  },
});

哪里有错误,请帮助我

enter image description here

0 个答案:

没有答案