代码拉取完成,页面将自动刷新
/**
* Created by rplees on 3/8/16.
*/
const React = require('react-native');
const Routes = require('../components/Routes');
const Ionicons = require('react-native-vector-icons/Ionicons');
const constant = require('../config').constant;
const TabBarDic = [constant.scene.project.key, constant.scene.famous.key, constant.scene.personal.key];//
const {
TabBarIOS
} = React;
const RootTab = React.createClass({
getInitialState() {
return {
selectedTab:TabBarDic[0],
}
},
componentDidMount() {
},
render() {
let cp = TabBarDic.map((v, i) => {
var routeCfg = Routes.getRouteCfg(v);
return <Ionicons.TabBarItem
key={'iconTabBarItem_' + v}
iconName={routeCfg.iconName}
selectedIconName={routeCfg.selectedIconName}
title={routeCfg.tabName}
selected={this.state.selectedTab === v}
onPress={() => {
this.setState({
selectedTab: v,
});
//Pop to the first scene in the stack, unmounting every other scene
this.refs["navigator_" + v] && this.refs["navigator_" + v].popToTop();
}}>
{Routes.navigator(v)}
</Ionicons.TabBarItem>
}
);
return <TabBarIOS>{cp}</TabBarIOS>
}
});
module.exports = RootTab;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。