国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > WEB開發(fā) > 正文

微信小程序-view的創(chuàng)建和使用

2024-04-27 15:13:19
字體:
來源:轉載
供稿:網(wǎng)友

今天寫第一篇關于微信小程序的學習,view的創(chuàng)建和使用。

微信小程序開發(fā)需要學習基本的標簽,這對我來說是一個挑戰(zhàn),不過加油啊。

1.創(chuàng)建一個View

在wxml中   <view class="section"></view>定義(容我這么說,對于iOS熟悉的人比較了解吧,不管對不對吧)。

在wxss中實現(xiàn)如下, 

.section {  flex: 1;  background-color: #ffff00;  font-size: 16px;

padding: 10px;

  margin: 10px;}

其中,background-color背景顏色,font-size是文字大小。padding文字與父試圖之間的距離,margin整個空間與父視圖中間距離。

2.view的樣式

 <view style="display : flex;flex-direction:row">        <view class="flex-item bc_green"></view>        <view class="flex-item bc_red"></view>            <view class="flex-item bc_blue"></view>

 </view>

class是一個控件,style是樣式,

"display : flex;flex-direction:row表示為橫向布局。display : flex;flex-direction:column豎向布局。

display : flex;flex-direction:row;justify-content:flex-start  橫向布局左側開始

display : flex;flex-direction:row;justify-content:flex-end   橫向布局右側開始

display : flex;flex-direction:row;justify-content:center      橫向布局居中

display : flex;flex-direction:row;justify-content:space-between     橫向布局子控件分開排列,左右間距為0

display : flex;flex-direction:row;justify-content:space-around        橫向布局子控件邊上有環(huán)繞

display : flex;height:200px;flex-direction:row;justify-content:space-around;align-items:flex-start      橫向布局子控件邊上有環(huán)繞+從上面開始 

display : flex;height:200px;flex-direction:row;justify-content:space-around;align-items:flex-end       橫向布局子控件邊上有環(huán)繞+從下面開始  

display : flex;height:200px;flex-direction:row;justify-content:space-around;align-items:center          橫向布局子控件邊上有環(huán)繞+從中間開始  

flex-item表示一個控件,在wuss中可定義如寬高,bc_green  bc_red  bc_blue 具體的顏色


上一篇:js編碼解碼

下一篇:百度HR給的JS面試題

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 金坛市| 灵璧县| 科技| 红河县| 宁夏| 封丘县| 宁阳县| 岚皋县| 沛县| 项城市| 仪征市| 永兴县| 项城市| 香格里拉县| 镇原县| 瓮安县| 清镇市| 宁南县| 景德镇市| 蕲春县| 治多县| 阿巴嘎旗| 炎陵县| 美姑县| 衡水市| 明水县| 上高县| 招远市| 新源县| 洪江市| 汤阴县| 汝州市| 禹城市| 中方县| 漠河县| 宣武区| 岚皋县| 绥中县| 虹口区| 松滋市| 蒙山县|