Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS keyboard opens and closes automatically but in android working fine. #17

Open
kamalpandey opened this issue Aug 3, 2020 · 0 comments

Comments

@kamalpandey
Copy link

kamalpandey commented Aug 3, 2020

"react-native-tab-view-viewpager-adapter": "^1.1.0",
"@react-native-community/viewpager": "^3.3.0",
"react-native-gesture-handler": "~1.6.0",
 "expo": "^38.0.0",
 "react": "16.11.0",
"react-native-reanimated": "~1.9.0",
"react-native-safe-area-context": "~3.0.7",
 "react-native-safe-area-view": "^1.1.1",
"react-native-tab-view": "2.15.0",
"react-navigation": "^4.0.9",
"react-navigation-stack": "^2.8.2",
"react-navigation-tabs": "^2.9.0",

import React from "react";
import { Text, View, Platform } from "react-native";
import ViewPagerAdapter from 'react-native-tab-view-viewpager-adapter';
import { createStackNavigator } from "react-navigation-stack";
import { createMaterialTopTabNavigator } from "react-navigation-tabs";

import {
  XYZScreen,
  ABCScreen
} from "../screens";

const settingsTab = createMaterialTopTabNavigator(
  {
    Basic: {
      screen: XYZScreen,
      navigationOptions: ({ navigation }) => ({
        tabBarLabel: ({ focused }) => (
          <View>
            <Text
              numberOfLines={1}
            >
              {navigation.state.routeName}
            </Text>
          </View>
        )
      })
    },
    Notifications: {
      screen: ABCScreen,
      navigationOptions: ({ navigation }) => ({
        tabBarLabel: ({ focused }) => (
          <View>
            <Text
              numberOfLines={1}
            >
              {navigation.state.routeName}
            </Text>
          </View>
        )
      })
    }
  },
  {
    initialRouteName: "Basic",
    swipeEnabled: true,
    animationEnabled: true,
    pagerComponent: ViewPagerAdapter,
    tabBarOptions: {
      scrollEnabled: true,
      upperCaseLabel: false
      style: {
        elevation: 0,
        borderBottomWidth: 0,
        backgroundColor: Colors.white
      }
  }
);

If I remove

pagerComponent: ViewPagerAdapter,

It works fine in IOS but not in android as it crashes during swipe at the first and last screen of the tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant