练习tabbarIOS报错



  • 小弟在练习tabbarIOS组件的时候 报这个错

    0_1468486078821_111.png

    下面的是我写的代码,望来人观望

    • index.ios.js

    /**

    import React, { Component } from 'react';
    import {
    AppRegistry,
    StyleSheet,
    Text,
    PixelRatio,
    View,
    NavigatorIOS,
    ScrollView,
    TextInput,
    Image,
    TouchableOpacity,
    TabBarIOS,
    } from 'react-native';

    var Box = React.createClass({
    getInitialState:function() {
    return {
    tab: 'home'
    }

    },

    select:function(tabName) {
    this.setState({
    tab:tabName
    });
    },

    render: function() {
    return(
    <TabBarIOS style={styles.flex}>

        <TabBarIOS.Item 
        title='home' 
        icon = {require('image!tabbar_home')} 
        onPress = {this.select.bind(this,'home')} 
        selected = {this.state.tab === 'home'}>
          <ScrollView>
            <View style = {styles.home}>
              <Text style = {styles.home_title}>南山南</Text>
            </View>
          </ScrollView>  
        </TabBarIOS.Item> 
    
        <TabBarIOS.Item 
        title='message' 
        icon = {require('image!tabbar_message_center')} 
        onPress = {this.select.bind(this,'home')} 
        selected = {this.state.tab === 'home'}>
          <ScrollView>
            <View style = {styles.home}>
              <Text style = {styles.home_title}>南山南</Text>
            </View>
          </ScrollView> 
        </TabBarIOS.Item>
    
        <TabBarIOS.Item 
        title='discover' 
        icon = {require('image!tabbar_discover')} 
        onPress = {this.select.bind(this,'discover')} 
        selected = {this.state.tab === 'discover'}>
          <ScrollView>
            <View style = {styles.home}>
              <Text style = {styles.home_title}>南山南</Text>
            </View>
          </ScrollView> 
        </TabBarIOS.Item>
    
      </TabBarIOS>
      );
    

    }

    }) ;

    const styles = StyleSheet.create({
    flex:{
    flex:1,
    alignItems:'center'
    },
    home:{
    alignItems:'center',
    marginLeft:5,
    marginRight:5,
    },
    home_title:{
    fontSize:18,
    color:'#18B5FF',
    marginBottom:5,
    }
    });

    AppRegistry.registerComponent('Box', () => Box);



  • 自己顶一下,希望大神回复下