我不敢相信我会问这个问题,因为它一定很简单。但我在react-native工作,必须使用flexbox,我认为这一点,但我是开放的建议。
***我意识到react native将使用视图而不是Div,但这个问题实际上是关于flexbox的,我将无法使用网格。虽然我也很好奇如何在网格中完成
使用以下标记:
<div class="container">
<div class="icon">icon button number one</div>
<div class="icon">an even larger text with stuff in it
two</div>
<div class="icon">a large bit of text three</div>
</div>
和CSS:
.container {
display: flex;
background-color: yellow;
width: 500px;
flex-direction: row-reverse;
flex-wrap: wrap;
border: 3px black solid;
}
.icon {
padding: 10px;
background-color: black;
color: white;
margin: 10px;
}
我希望能够动态地从底部增长这个按钮的“列表”。
就像这样,集装箱里的潜水员排成一排
<an even larger text with stuff in it two> <icon button number one>
<a large bit of text three>
但我想让它们像这样排好:
<a large bit of text three>
<an even larger text with stuff in it two> <icon button number one>
当项目最终将被动态添加时,如何让它们自下而上增长?
https://codepen.io/sias/pen/ZEjmXBj
2条答案
按热度按时间hrirmatl1#
我希望这是你想要的 Package 反向只是颠倒和开始和结束交换
qqrboqgw2#
像这样?