這篇文章主要講解了“小程序中怎么實(shí)現(xiàn)view視圖容器”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“小程序中怎么實(shí)現(xiàn)view視圖容器”吧!
創(chuàng)新互聯(lián)建站是一家專注于成都做網(wǎng)站、網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),鹽邊網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)建站做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:鹽邊等地區(qū)。鹽邊做網(wǎng)站價(jià)格咨詢:18980820575視圖容器
// wxmlflex-direction: row 1 2 3
// wxss .flex-wrp_one{ display: flex; flex-direction: row; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
圖片
// wxmlflex-direction: column 1 2 3
// wxss .flex-wrp_two{ display: flex; flex-direction: column; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
圖片
// wxmljustify-content: flex-start 1 2 3
// wxss .flex-wrp_three{ display: flex; justify-content: flex-start; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
// wxmljustify-content: flex-end 1 2 3
// wxss .flex-wrp_four{ display: flex; justify-content: flex-end; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
// wxmljustify-content: center 1 2 3
// wxss .flex-wrp_five{ display: flex; justify-content: center; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
// wxmljustify-content: space-between 1 2 3
// wxss .flex-wrp_six{ display: flex; justify-content: space-between; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
// wxmljustify-content: space-around 1 2 3
// wxss .flex-wrp_seven{ display: flex; justify-content: space-around; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
// wxmljustify-content: space-evenly 1 2 3
// wxss .flex-wrp_eight{ display: flex; justify-content: space-evenly; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
view
屬性
排列方式(flex-direction) | 描述 |
---|---|
row | 橫向排列 |
column | 縱向排列 |
項(xiàng)目?jī)?nèi)容對(duì)齊(justify-content) | 描述 |
---|---|
flex-start | 向行頭緊挨 |
flex-end | 向行尾緊挨 |
center | 居中緊挨 |
space-between | 平均分布 |
space-around | 平均分布 ,兩邊留有一半間隔 |
space-evenly | 兩邊間隔與中間相同 |
源碼
// wxmlflex-direction: row 1 2 3 flex-direction: column 1 2 3 justify-content: flex-start 1 2 3 justify-content: flex-end 1 2 3 justify-content: center 1 2 3 justify-content: space-between 1 2 3 justify-content: space-around 1 2 3 justify-content: space-evenly 1 2 3
// wxss .flex-wrp_one{ display: flex; flex-direction: row; } .flex-wrp_two{ display: flex; flex-direction: column; } .flex-wrp_three{ display: flex; justify-content: flex-start; } .flex-wrp_four{ display: flex; justify-content: flex-end; } .flex-wrp_five{ display: flex; justify-content: center; } .flex-wrp_six{ display: flex; justify-content: space-between; } .flex-wrp_seven{ display: flex; justify-content: space-around; } .flex-wrp_eight{ display: flex; justify-content: space-evenly; } .flex-item{ width: 100px; height: 100px; } .bc_green{ background: green; } .bc_red{ background: red; } .bc_blue{ background: blue; }
感謝各位的閱讀,以上就是“小程序中怎么實(shí)現(xiàn)view視圖容器”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)小程序中怎么實(shí)現(xiàn)view視圖容器這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!