加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.ios.js 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
0-hun 提交于 2016-04-12 19:06 . 初始化项目
'use strict';
var React = require('react-native');
var List = require('./include/tpl/list');
var List2 = require('./include/tpl/list2');
var List3 = require('./include/tpl/list3');
var Video = require('./include/tpl/video');
var Users = require('./include/tpl/users');
var {
AppRegistry,
Navigator,
StatusBarIOS
} = React;
StatusBarIOS.setHidden(true);
var DotaVideo = React.createClass({
renderScene(router, navigator){
var Component = null;this._navigator = navigator;
switch(router.name){
case "list":
Component = List;
break;
case "list2":
Component = List2;
break;
case "list3":
Component = List3;
break;
case "users":
Component = Users;
break;
break;
case "video":
Component = Video;
break;
default: //default view
Component = List;
}
//console.log("==>renderScene",router,(new Date));
return <Component navigator={navigator} {...router.passProps}/>
},
componentDidMount() {
//var navigator = this._navigator;
},
render() {
return (
<Navigator
initialRoute={{name: 'list'}}
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FadeAndroid;
}}
/>
);
}
});
AppRegistry.registerComponent('DotaVideo', () => DotaVideo);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化