所以,这是我的一部分代码:
tabBarOptions={{
style: styles.topTabbar,
renderIndicator: () => null,
iconStyle: styles.iconStyle,
showLabel: false,
pressColor: "#FDF5F1",
showIcon: true,
scrollEnabled: true,
tabStyle: {
width: 100,
borderWidth: 1
}
}}
在这里,我为其指定tabStyle属性和宽度。它适用于我的标签栏的每个元素,但是我需要为每个组件设置不同的宽度。如何在React Navigation 5中这样做?
答案 0 :(得分:0)
只写这样:
tabStyle1: {
width: 100,
borderWidth: 1
}
tabStyle2: {
width: 100,
borderWidth: 1
}
tabStyle3: {
width: 100,
borderWidth: 1
}
,依此类推。 tabStyle属性后写的数字取决于您需要更改的图标