小编Dem*_*nix的帖子

键盘显示时,createBottomTabNavigator空白(图标是自动隐藏)

React-native应用程序的版本:

react@16.9.0
react-native@0.61.2
react-navigation@^4.0.10
react-navigation-stack@^1.10.3
react-navigation-tabs@^2.5.6
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用createBottomTabs创建应用程序,当我尝试输入TextInput时,当键盘显示时,有带图标的bottomtabs,该图标将自动隐藏,在键盘顶部留下空白/空白

我的代码示例:

<SafeAreaView style={
   flex: 1,
   alignItems: 'center'
}>
   <View>
     <TextInput />
   </View>
</SafeAreaView>
Run Code Online (Sandbox Code Playgroud)

已经尝试使用KeyboardAvoidingView更改SafeAreaView,但是空格/空白仍然存在。

const MainTabs = createBottomTabNavigator({
  Screen1: {
    screen: Screen1Stack,
    navigationOptions: {
      tabBarIcon: Icon
    }
  },
  Screen2: {
    screen: Screen2Screen,
    navigationOptions: {
      tabBarIcon: Icon
    }
  },
  Screen3: {
    screen: Screen3Screen,
    navigationOptions: {
      tabBarIcon: Icon
    }
  },
  Screen4: {
    screen: Screen4Screen,
    navigationOptions: {
      tabBarIcon: Icon
    }
  },
},
  {
    tabBarOptions: {
      ...
      showLabel: false
    }
  }
)
Run Code Online (Sandbox Code Playgroud)

没有键盘 键盘秀

react-native react-navigation

4
推荐指数
1
解决办法
128
查看次数

标签 统计

react-native ×1

react-navigation ×1