了解reactnative并知道如何使用reactnative导航的人。
我正在创建一个开源应用程序,并在其上使用MaterialTopTabNavigator。当我设置选项卡和指示器的样式(使用indicatorStyle和tabStyle)时,选项卡会覆盖指示器,使其不可见。有人知道怎么修吗?我想让指示器覆盖在选项卡上,而不是相反
GitHub存储库:https://www.github.com/arthrc/packly src/route.js第30~49行
export default function Routes() {
return (
<Tab.Navigator
initialRouteName='Home'
tabBarOptions={{
activeTintColor: '#fff',
inactiveTintColor: '#f7f7f7',
tabStyle: { backgroundColor: '#a500ff'},
indicatorStyle: {
height: 6,
bottom: -3,
backgroundColor: '#D70CE8',
width:100,
},
labelStyle: {
fontFamily: 'Inter_600SemiBold',
fontSize: 16
}
}}
>发布于 2020-09-28 06:04:07
我刚刚把tabStyle改成了style,它工作得很好
最终代码:
export default function Routes() {
return (
<Tab.Navigator
initialRouteName='Home'
tabBarOptions={{
activeTintColor: '#fff',
inactiveTintColor: '#f7f7f7',
tabStyle: { backgroundColor: '#a500ff'},
indicatorStyle: {
height: 6,
bottom: -3,
backgroundColor: '#D70CE8',
width:100,
},
labelStyle: {
fontFamily: 'Inter_600SemiBold',
fontSize: 16
}
}}
>https://stackoverflow.com/questions/64093380
复制相似问题