使用React-Native-Scrollable-Tab-View弹出到上一个场景

时间:2016-01-23 18:32:40

标签: tabs stack react-native

似乎在使用react-native-scrollable-tab-view时,如果在选项卡组件中创建详细信息页面,则无法弹回到上一个场景 - 它只是弹回到选项卡的初始索引 - 视图。这就是我的意思:

https://drive.google.com/file/d/0ByEXXlwyI4z7N29OLVRScDVNRzA/view?usp=sharing

有可能解决这个问题吗?

以下是tab-view的代码:

//home page that connects everything together in app index
var React = require('react-native');
var { Text, Image, View, StyleSheet, ScrollView} = React;
//libraries
var ScrollableTabView = require('react-native-scrollable-tab-view');
//components
var TabBar = require('../components/TabBar');
//screens
var Explore = require('./explore');
var Home = require('./home');
var Recipes = require('./recipes');
var Profile = require('./profile');
var RecipePhoto = require('./recipe-photo.js')
//dimensions
var Dimensions = require('Dimensions');
var window = Dimensions.get('window');

module.exports = React.createClass({
  render: function() {
    return <View style={styles.container}>
        <ScrollableTabView
          tabBarPosition={'bottom'}
          initialPage={0}
          renderTabBar={() => <TabBar />}>
          <ScrollView tabLabel="ion|android-home">
            <Home navigator={this.props.navigator} />
          </ScrollView>
          <ScrollView tabLabel="ion|android-list">
            <Recipes navigator={this.props.navigator} />
          </ScrollView>
          <ScrollView tabLabel="ion|android-camera">
            <RecipePhoto navigator={this.props.navigator} />
          </ScrollView>
          <ScrollView tabLabel="ion|search">
            <Explore navigator={this.props.navigator} />
          </ScrollView>
          <ScrollView tabLabel="ion|person-stalker">
            <Profile navigator={this.props.navigator} />
          </ScrollView>
        </ScrollableTabView>
      </View>
  }
});

var styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  tabView: {
    flex: 1,
    padding: 10,
    backgroundColor: 'rgba(0,0,0,0.01)',
  },
  card: {
    borderWidth: 1,
    backgroundColor: '#fff',
    borderColor: 'rgba(0,0,0,0.1)',
    margin: 5,
    height: 150,
    padding: 15,
    shadowColor: '#ccc',
    shadowOffset: {width: 2, height: 2},
    shadowOpacity: 0.5,
    shadowRadius: 3,
  },
});

0 个答案:

没有答案