tabbarIOS

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TextInput,
  TouchableHighlight,
  TouchableOpacity,
  Image,
  TabBarIOS,

} from 'react-native';
var imgs=[
'http://img3.imgtn.bdimg.com/it/u=3095238459,1538292730&fm=21&gp=0.jpg','http://img.mypsd.com.cn/e/d/%e7%9f%a2%e9%87%8f%e5%9b%be%e5%ba%93/%e7%9f%a2%e9%87%8f%e4%ba%ba%e7%89%a9/%e5%85%b6%e4%bb%96/d/jpg/d90-wjdjawjkdjkwajdk%20%28262%29.jpg','http://pic.58pic.com/58pic/14/10/61/46J58PICa3v_1024.jpg',
];

class MyImage extends Component{
  constructor(props){
    super(props);
    
    var imgs=this.props.imgs;

    this.state={
      imgs:imgs,
      count:0
    }
  }

   render(){
    return(
      
        
          
        
      
        this.goPreview}>
          
            上一张
          
        
         this.goNext}>
          
            下一张
          
        
      
       
      )
  }


}

class tabBar extends Component{
constructor(props) {
    super(props);
    this.state = { 
selectedTab: 'greenTab',
      notifCount: 0,
      presses: 0,
    };
   
  }
  render(){
    return( 
 
          {this.setState({
              selectedTab: 'blueTab',
            });}} selected={this.state.selectedTab === 'blueTab'}>
            1
          
           {this.setState({
              selectedTab: 'redTab',
            });}}  selected={this.state.selectedTab === 'redTab'}>
            2
          
           {this.setState({
              selectedTab: 'greenTab',
            });}} selected={this.state.selectedTab === 'greenTab'}>
            3
          
        
      )
  }
}

class demo extends Component {
  
  render() {
    return (
      
        
        
        
     

    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  image:{
    borderWidth:1,
    width:300,
    height:200,
    borderRadius:5,
    borderColor:"#ccc",
    justifyContent:"center",
    alignItems:"center",
    marginTop:40,


  },
  img:{
    height:150,
    width:200,
  },
  btns:{

    flexDirection:"row",
    justifyContent:"center",
    marginTop:20,
  },
  btn:{
    width:60,
    height:30,
    justifyContent:"center",
    alignItems:"center",
    marginRight:20,
    borderColor:"grey",
    borderWidth:1,
  },
  
});

AppRegistry.registerComponent('demo', () => tabBar);

你可能感兴趣的:(tabbarIOS)