我正在尝试将边框半径添加到底部栏,但是这样
我想将容器颜色从默认更改为紫色。
我怎样才能做到这一点 ?
到目前为止我做了什么
我想要的是
Code:
tabBarOptions: {
activeTintColor: colors.primary,
inactiveTintColor: colors.black,
showLabel: false,
style: {
borderWidth: 0.5,
borderBottomWidth: 1,
backgroundColor: 'white',
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
borderColor: colors.lightGrayText,
},
},
任何人都可以帮忙吗?
thanks
您必须添加一个绝对位置,这将使选项卡栏保持在边框内
tabBarOptions={{
activeTintColor: 'red',
inactiveTintColor: 'black',
showLabel: false,
style: {
borderWidth: 0.5,
borderBottomWidth: 1,
backgroundColor: 'red',
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
borderColor: 'grey',
position: 'absolute'
},
}}>
参考https://github.com/react-navigation/react-navigation/issues/5928 https://github.com/react-navigation/react-navigation/issues/5928
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)