【问题标题】:Indicator is not rendering on iOS and Android指标未在 iOS 和 Android 上呈现
【发布时间】:2019-10-29 20:16:27
【问题描述】:

我正在尝试在选项卡导航上呈现 topBar,但它没有显示

import { createBottomTabNavigator, createAppContainer } from "react-navigation";

const TabNavigator = createBottomTabNavigator(
  {
    Dashboard: {
      screen: Dashboard,
      navigationOptions: {
        title: "Dashboard",
        tabBarIcon: ({ tintColor }) => (
          <Icon
            name="home"
            type="Entypo"
            style={{
              color: tintColor,
            }}
            color={tintColor}
          />
        ),
      },
    },
  },
  {
    tabBarPosition: "top",
    tabBarOptions: {
      activeTintColor: "#5D10F6",
      inactiveTintColor: "gray",
      showIcon: true,
      tintColor: "#333",
      animationEnabled: false,
      showLabel: false,
      scrollEnabled: true,
      tabBarPosition: "top",
      indicatorStyle: {
        backgroundColor: "red",
      },
    },
  }
);

【问题讨论】:

    标签: react-native


    【解决方案1】:

    注意:createTabNavigator 在 react-navigation@3.x 中被移除。请改用 createBottomTabNavigator 和/或 createMaterialTopTabNavigator。

    然而createBottomTabNavigator 不再支持indicatorStyle :(

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-24
    • 2019-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-03
    相关资源
    最近更新 更多