首页 > 代码库 > React Native 开发之 (08) FlexBox例子

React Native 开发之 (08) FlexBox例子

1 example1

RectNative View demo 参考 http://reactnative.cn/docs/0.31/view.html#content

index.ios.js

import React, { Component } from react;import {  AppRegistry,//注册  StyleSheet,//样式  Text,     //文本组件  View,      //视图组件} from react-native;class ADemo extends Component {  //初始化方法-->返回具体的组件内容  render() {    return(      <View style={styles.container}>      <Text>你好 !!</Text>      </View>    );  }}const styles = StyleSheet.create({  container: {    flex: 1,    justifyContent: center,    alignItems: center,    backgroundColor: red,  },  welcome: {    fontSize: 20,    textAlign: center,    margin: 10,  }});AppRegistry.registerComponent(ADemo, () => ADemo);

 

 

 

参考资料 http://reactnative.cn/

 

React Native 开发之 (08) FlexBox例子