想要达到的效果:
目前效果:
代码和样式如下:
如果把rightTitle的flex-direction设成row-reverse,右边部分靠右了,但是里面的字体会颠倒,请问有什么解决办法?
一行有两个view,怎么一个左对齐,一个右对齐?There are two views in a row, how can one be left-aligned and the other right-aligned?
一行有两个view,怎么一个左对齐,一个右对齐?想要达到的效果:
目前效果:
代码和样式如下:
如果把rightTitle的flex-direction设成row-reverse,右边部分靠右了,但是里面的字体会颠倒,请问有什么解决办法?
The desired effect: the current effect: the code and style are as follows: if the flex direction of righttitle is set to row reverse, the right part is on the right, but the font inside will be reversed. What is the solution?
回答:
1、在左view和右view之间加一个view,flex:1即可。
.propertyBox{ display: flex; flex-wrap: nowrap; align-items: center;}.leftTitle{ flex:1;}
.propertyBox{ display: flex; justify-content: space-between; align-items: center;}
.propertyBox {justify-content: space-between;}
box样式
display: flex;
align-items: center;
justify-content: space-between;