React-Native 引用样式的方式

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

class hello extends Component {
  render() {
   return (
  
    
    1  第一种样式
    
    
    2 第二种样式
    
    
    3
    

    
    4  第三种样式
    
    
    5
    
    
    6
    
    
    reactView7  第四种样式
    
  
);
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'red',
    flexDirection:'row',
    flexWrap:'wrap',
    alignItems:'center',
    justifyContent:'space-around',
    alignSelf:'stretch',
  },

  viewStyle:{
    backgroundColor:'green',
    height:100,
    width:100
  },
viewStyleCon:{
  alignItems:'center',
  justifyContent:'center'
},
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});
AppRegistry.registerComponent('hello', () => hello);

你可能感兴趣的:(React-Native 引用样式的方式)