当键盘打开时,如何隐藏塔巴尔

问题描述 投票:0回答:5
目前,TABBARBOTTOM放置在键盘上方几秒钟,然后将其下降。 打开键盘时,我想完全隐藏塔巴尔。

expo sdk :- 38 react-navigation": “^4.0.9”, “react-navigation-tabs”: “^2.9.0”, "Plaform: "Android"

	
javascript android react-native expo react-navigation
5个回答
13
投票

tabaroptions被弃用,您可以在ScreenOptions中尝试

4
投票

您可以在tabbaroptions中尝试

keyboardHidesTabBar: true

1
投票

Prebaesto

<Tab.Navigator initialRouteName="Feed" tabBarOptions={{ activeTintColor: '#e91e63', keyboardHidesTabBar: true //<===== }} >

1
投票

使用这个社区钩子(它将一定会起作用)

0
投票

NPMinstall @react-native-native-community/hooks

键盘基础上的Rander键盘打开或不开放

import { Tabs } from "expo-router"; import { useKeyboard } from "@react-native-community/hooks"; export default function TabLayout() { const keyboard = useKeyboard(); return ( <Tabs initialRouteName="home" screenOptions={{ tabBarActiveTintColor: "white", tabBarInactiveTintColor: "white", tabBarShowLabel: false, tabBarStyle: keyboard.keyboardShown ? { display: "none" } // Hide tab bar when keyboard is open : { display: "flex", flexDirection: "row", alignItems: "center", }, }} > <Tabs.Screen name="home" options={{ title: "Home", headerShown: false, tabBarIcon: ({ focused }) => ( <TabIcon source={icons.home} focused={focused} /> ), }} /> </Tabs> ); }

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.