【问题标题】:How to hide the title of react navigation's TabNavigator I would like to show only Icon [duplicate]如何隐藏反应导航的TabNavigator的标题我只想显示图标[重复]
【发布时间】:2017-10-16 15:27:28
【问题描述】:

在屏幕内部,我设法通过将其设置为空来隐藏标题,如下所示

static navigationOptions = {
  title: "" 
};

但是对于每个屏幕我都必须将标题设置为空我想知道是否有任何属性可以默认隐藏标题并且只显示图标?

【问题讨论】:

    标签: react-native react-navigation tabnavigator


    【解决方案1】:

    参考 react-navigationsdocumentation,可以使用 tabBarOptions 中的 showLabel 来隐藏标签。默认设置为真。

    TabNavigator(
            {
              MyScreen: { screen: MyScreen }
            },
            {
              tabBarOptions: {
                showLabel: false,
                showIcon: true
              }
            }
          )
    

    【讨论】:

    • 它有效,谢谢我之前尝试在文档中找到它,但术语标题和标签会造成混淆。
    猜你喜欢
    • 1970-01-01
    • 2019-09-27
    • 2020-09-08
    • 1970-01-01
    • 1970-01-01
    • 2015-06-03
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    相关资源
    最近更新 更多