摆脱顶部标签的边框(反应导航)

时间:2020-04-13 05:05:57

标签: react-native

我正在使用react-navigation,当我使用top-tab和stack时,会出现此边框。 enter image description here

如何删除此内容? 我的代码看起来像这样

const ShoutoutTopTab = createMaterialTopTabNavigator();

const ShoutoutTopTabScreen = () => {
  return (<ShoutoutTopTab.Navigator
    tabBarOptions={{
      indicatorStyle: {backgroundColor:'#4A6159'},
      tabStyle: {}
    }} >
    <ShoutoutTopTab.Screen name="GLOBAL" component={GlobalShoutout}/>
    <ShoutoutTopTab.Screen name="COUNTRY" component={CountryShoutout}/>
  </ShoutoutTopTab.Navigator>)
}

4 个答案:

答案 0 :(得分:0)

尝试一下

tabBarOptions = {{
  indicatorStyle: { backgroundColor: '#4A6159' },
  tabStyle: {
    borderBottomWidth: 0
  }
}} >

答案 1 :(得分:0)

您可以这样做:

headerStyle: {
    borderBottomWidth: 0,
}

答案 2 :(得分:0)

对于仍有问题的任何人,请尝试:

(在 material-top-tabs 5.3.14 中测试)

tabBarOptions = {{
  style: {
  shadowOpacity: 0
  }
}}

答案 3 :(得分:0)

看起来像底部边框的东西实​​际上是一个阴影。

tabBarOptions = {{
  style: {
  shadowOpacity: 0,
  elevation: 0,
  }
}}

这适用于 IOS 和 Android。在 5.3.15 上测试。