当前位置:网站首页>Flex layout justify content: the solution of left aligning the last line of space between
Flex layout justify content: the solution of left aligning the last line of space between
2022-07-19 16:36:00 【A Huang Junhui a】
In the layout of the front end , We use it a lot flex Layout , When you meet Divided into two columns perhaps n When the column , Nature will use space-between. however , If it's one line , There is no problem with the above , If you want it to wrap automatically , It may not be the effect we want

The situation above is The last line becomes aligned
My solution is Dynamic complementary element alignment
It's a common problem , The factors we have determined are
- I'm going to show how many data in one row ( in other words , I'm going to divide it into several columns )
- How many times do I have data ( If the data is requested from the interface , Use array.length You will know how many pieces of data there are )
With the above two data , We knew , I complement this element , How many are needed
such as We have to divide N bar , My data is M strip , Then the number we need to make up is (N - M%N)
So for the above figure , I have a 6 individual image label I want to share 4 bar , So we The number of complementary elements is (4-6%4)

The above problems are perfectly solved
Special note , Small program , Set up a loop , If there is a fixed number of times , It's written like this
For example, I want to cycle 10 Time
<view wx:for="{
{10}}"></view> // That's it
边栏推荐
- 开发idea插件在提交审核时因为兼容性问题未通过
- 张朝阳夜跑33公里:直播聊物理 揭示“超级月亮”成因
- Design and implementation of tcp/ip protocol stack LwIP: Part 4
- JMeter 21 天打开 day11
- 揪心!56岁老父亲为了给孩子筹学费,高温工作9小时去世
- Object memory layout and synchronized lock upgrade
- VS2019 MFC Slider Control 控件继承CSliderCtrl类重绘 自绘
- NFT市场格局仍未变化,Okaleido能否掀起新一轮波澜?
- 同花顺软件炒股线上开户收费吗?开户安全吗?
- 05.位图和比较器的简单应用
猜你喜欢
![[C language] 10000 word document operation summary](/img/3b/8f6c9b464f2b0c30c12fc91ad915e2.png)
[C language] 10000 word document operation summary

JMeter 21 天打卡 day12

JMeter 21 天打卡 day08

圆环形材质mask

JMeter opens Day11 in 21 days

Weekly resume of personal IP lab · issue 19

The NFT market pattern has not changed. Can okaleido set off a new round of waves?

Summarize the strange interaction between reader and live broadcast: review ShuangDi Technology

使用深度學習制作機器人大腦圖紙

Handwritten simple promise code comments
随机推荐
MySQL - unique key constraint for table fields
二手房房价分析与预测(图表绘制避免中文乱码、饼形图、折线图、条形图(柱形图)、enumerate函数、数据清洗(lambda\map)、二手房预测(scikit-learn))
Stm32+a4988 control stepper motor
Dijkstra序列(DAY 66)
The IPO of Aoyang technology was terminated: the annual revenue was 800million, and Su Wei held 67.5% equity
软件测试周刊(第80期):当你想倾诉的话语已经涌到了舌尖,但是把那些话憋回去的瞬间,从那个瞬间起,你就成为了大人。
OS知识点简介(二)
JMeter 21 天打开 day11
梅科尔工作室-DjangoWeb 应用框架+MySQL数据库第四次培训
思必驰冲刺科创板:年营收3亿亏3.4亿 阿里与联想之星是股东
MySQL - default value constraint for table fields
关于df命令由于设备名太长自动换行的问题
Chapter 4: emerging, class instantiation strategy with constructor based on cglib
圆环形材质mask
[C language] 10000 word document operation summary
【VScode输出为乱码】解决方法
使用深度学习制作机器人大脑图纸
Torus material mask
06. Binary tree and simple application
VS2019 MFC动态创建EDIT控件 ,CSliderCtrl类成员函数Create应用创建Slider Control控件[MFC动态创建控件四]