材质顶部标签标签未显示

问题描述 投票:0回答:1

这是我的代码

import React from "react";
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
import Categories1Screen from "./Categories1Screen";
import Categories2Screen from "./Categories2Screen";
import Categories3Screen from "./Categories3Screen";

const Tab = createMaterialTopTabNavigator();

export default function CategoryScreen() {
  return (
    <Tab.Navigator initialRouteName="Categories1">
      <Tab.Screen name="Categories1" component={Categories1Screen} />
      <Tab.Screen name="Categories2" component={Categories2Screen} />
      <Tab.Screen name="Categories3" component={Categories3Screen} />
    </Tab.Navigator>
  );
}

我的问题是,我看不到类别 1、类别 2、类别 3 等标签。

这里是发生错误的地方:

enter image description here

我期待这样的结果:

enter image description here

我安装了足够的依赖项,我不明白为什么它不起作用。我尝试添加 screenOptions 和选项,但它也不起作用。

react-native react-navigation-top-tabs
1个回答
0
投票

也许 Tab.Screen 的父元素设置了白色

© www.soinside.com 2019 - 2024. All rights reserved.