gpt4 book ai didi

react-native - justifyContent : 'space-evenly' in React Native

转载 作者:行者123 更新时间:2023-12-04 04:08:43 40 4
gpt4 key购买 nike

我可以使用 justifyContent: 'space-evenly'在 React Native 中的任何元素上?在哪些上?语法应该是什么样的?

谢谢!

最佳答案

正如@Ben 所提到的,您可以使用 justifyContent: 'space-evenly'从 RN 0.52.0+ 开始。

对于您问题的第二部分,即“在哪些方面?”

Justify Content
Adding justifyContent to a component's style determines the distribution of children along the primary axis. Should children be distributed at the start, the center, the end, or spaced evenly? Available options are flex-start, center, flex-end, space-around, and space-between. link to docs



因此,从逻辑上讲,它应该用于 容器 View 元素 沿着主轴布置它的 child 。

问题的第三部分“语法应该是什么样的?”

语法很简单,你可以像这样使用它
<View style={{justifyContent: 'space-evenly'}}>children views...</View>
有关 justifyContent 的更多详细信息您可以访问 this link

关于react-native - justifyContent : 'space-evenly' in React Native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47137445/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com