UIImageView的创建(React Native)

前端之家收集整理的这篇文章主要介绍了UIImageView的创建(React Native)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

UIImageView的创建(React Native)

by 伍雪颖


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

class UIImageView extends React.Component {
  render() {
    return (
      <View style={styles.bgview}>
          <Image
            source  = {{uri:'http://img.wdjimg.com/image/video/64d23dde9daac32367954b7c8a803da0_0_0.jpeg'}}
            style = {styles.image} />
        </View>
      );
  }
}

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

var styles = React.StyleSheet.create({
  container: {
    flex: 1
  },bgview: {
    backgroundColor: '#eeeeee',paddingTop: 75,paddingLeft: 10,paddingRight: 10,paddingBottom: 10,},image:{width:200,height:200,marginRight:10},});

React.AppRegistry.registerComponent('SampleApp',function() { return SampleApp });
原文链接:https://www.f2er.com/react/307991.html

猜你在找的React相关文章