码迷,mamicode.com
首页 > 其他好文 > 详细

UITableViewCell组合创建(React Native)

时间:2015-04-04 10:45:29      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:ios   react native   

UITableViewCell组合创建(React Native)

by 伍雪颖

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

class UIImageView extends React.Component {
  render() {
    return (
      <View style={styles.bgview}>
          <View style = {styles.cellBgView}>
          <Image
            source  = {{uri:'http://img.wdjimg.com/image/video/64d23dde9daac32367954b7c8a803da0_0_0.jpeg'}}
            style = {styles.image} />
          <View style = {styles.cellView}>
            <Text style={styles.title}>
             Xueyingwu
            </Text>
            <Text style = {styles.subtitle}>
            Work in China
            </Text>
            </View>
        </View>
        </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,
  },
  cellBgView:{flexDirection:'row',margin:40},
  image:{width:40,height:40,marginRight:10},
  cellView:{flex:1,justifyContent:'center',backgroundColor:'#ffffff'},
  title:{fontSize:11,fontWeight:'bold',backgroundColor:'#ffffff'},
  subtitle:{fontSize:10},
});

React.AppRegistry.registerComponent('SampleApp', function() { return SampleApp });


UITableViewCell组合创建(React Native)

标签:ios   react native   

原文地址:http://blog.csdn.net/rainlesvio/article/details/44870883

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!