阅读背景:

UILabel创建(React Native)

来源:互联网 

UILabel创立(React Native)

by 伍雪颖


"use strict";
var React = require("react-native");
var {
  AppRegistry,
  StyleSheet,
  View,
  Text,
} = React;

class UILabel extends React.Component {
  render() {
    return (
      <View style={styles.bgview}>
          <Text style = {styles.label}>
        Hello, React Native!
        </Text>
        </View>
      );
  }
}

class SampleApp extends React.Component {
  render() {
    return (
      <React.NavigatorIOS
        style={styles.container}
        initialRoute={{
          title: "My App",
          component: UILabel,
        }}/>
    );
  }
}

var styles = React.StyleSheet.create({
  container: {
    flex: 1
  },
  bgview: {
    backgroundColor: "#eeeeee",
    paddingTop: 75,
    paddingLeft: 10,
    paddingRight: 10,
    paddingBottom: 10,
  },
  label: {
    alignItems:"center",
    backgroundColor:"#ff0000",
    fontSize:20,
    textAlign:"center",
    margin:50,
  },
});

React.AppRegistry.registerComponent("SampleApp", function() { return SampleApp });"use strict";




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: