简体   繁体   English

如何从 React Navigation 5 更改标签栏图标之间的距离?

[英]How can I change distance between icons of the tabbar from React Navigation 5?

So, here is what I currently have:所以,这是我目前拥有的:

在此处输入图片说明

And I need distance between icons to be equal.我需要图标之间的距离相等。 That's what I'm unable to do using tabStyle prop like this:这就是我无法像这样使用 tabStyle 道具做的事情:

tabStyle: {
    width: whatever
}

cause distance is not equal.因为距离不相等。 How can I do so in React Navigation 5?我如何在 React Navigation 5 中这样做?

I assume you want the labels to be as wide as the content instead of stretching to available width.我假设您希望标签与内容一样宽,而不是拉伸到可用宽度。 In that case, you need to set width to auto :在这种情况下,您需要将width设置为auto

tabStyle: {
  width: 'auto'
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 React Navigation 5 创建自定义标签栏? - How can I create a custom tabbar using React Navigation 5? 如何覆盖 tabBarOptions 并更改导航图标的颜色? - How can I override tabBarOptions and change the color of the navigation icons? 如何使用 React Navigation 在 React Native (Android) 上获得底部 TabBar - How can I get a bottom TabBar on React Native (Android) with React Navigation 我如何在 React 中动态更改 Fontawesome 图标? - How can i change Fontawesome icons dynamically in React? 反应导航更改标签栏下方的背景颜色 - React Navigation change backgroundColor below tabBar 如何增加 React 中两个按钮之间的距离? - How can I increase the distance between two buttons in React? React Bootstrap:如何将 Dropdown.Toggle 的图标从箭头图标更改为 React Icon 的其他一些图标? - React Bootstrap: How can I change the icon of Dropdown.Toggle from the arrow icon to some other icons from React Icon? 无法从反应图标库中更改这些图标的颜色 - can't change color of these icons from react icons library 如何替换 react-material-ui datepicker 的导航图标? - How can i replace the navigation icons of react-material-ui datepicker? React-Datepicker:如何更改导航箭头? - React-Datepicker: How can I change the navigation arrows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM