0

当我通过tabBar函数使用自定义标签栏时tabBarHideOnKeyboard不起作用但没有tabBar函数它可以正常工作,任何关于如何使用tabBar函数使其工作的想法。

4

2 回答 2

0

您将从tabBarHideOnKeyboardcustom 的道具中获得tabBar

tabBar={(props) => {
  return (
    <View>
      {props.state.routes.map((route, index) => {
        // You can replace Pressable and View with anything you like
        return (
          props.descriptors[route.key].options.tabBarHideOnKeyboard && (
            <Pressable>
              <View
                style={{
                  width: 200,
                  height: 200,
                  backgroundColor: "green",
                }}
              />
            </Pressable>
          )
        );
      })}
    </View>
  );

你可以在这里阅读更多

于 2021-11-24T09:46:09.000 回答
0

在“android”键下添加"softwareKeyboardLayoutMode": "pan"app.json 文件,然后重新启动您的 expo 服务器expo start -c

于 2022-01-01T18:23:18.257 回答