0

我正在使用来自这个库https://reactnavigation.org/docs/navigators/tab的 TabNavigator 并且在屏幕上我有 ScrollView 它真的很长而且我的选项卡被隐藏了,如何才能不隐藏选项卡?

这是代码:

const TabNav = TabNavigator({
    Home: {
        screen: Home,
        navigationOptions: {
            title: 'Home',
            headerLeft: null
        }
    },
    Notes: {
        screen: Notes,
        navigationOptions: {
            title: 'Notes',
            headerLeft: null
        }
    },
    Tasks: {
        screen: Tasks,
        navigationOptions: {
            title: 'Tasks',
            headerLeft: null
        }
    },
    Events: {
        screen: Events,
        navigationOptions: {
            title: 'Events',
            headerLeft: null
        }
    }
}, {
    tabBarOptions: {
        activeTintColor: 'green'
    },
});


const plannings = StackNavigator({
    Login: {
        screen: Login,
        navigationOptions: {
            header: null
        }
    },
    Register: {
        screen: Register,
        navigationOptions: {
            header: null
        }
    },
    Home: {
        screen: TabNav
    }
}, {
    headerMode: 'screen'
});
4

1 回答 1

-2

我找到了这个解决方案,它对我有用:

<View style={{flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'blue'}}>
     <View style={{height: 400, width: 400}}>                 
       <ScrollView>
         <View style={{backgroundColor: 'green'}}>
            // Your data here
         </View> 
      </ScrollView>
      <TextInput style={{backgroundColor: '#c4c4c4dd', position: 'absolute', bottom: 0, left: 0, right: 0}} />
    </View>
  </View>  
于 2017-05-28T10:27:11.843 回答