当ScrollView很长时,React Native TabNavigator隐藏

时间:2017-05-22 19:00:58

标签: react-native tabnavigator

我正在使用此库中的TabNavigator https://reactnavigation.org/docs/navigators/tab 在屏幕上我有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'
});

1 个答案:

答案 0 :(得分:-1)

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

<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>