国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 沭阳县| 蒙自县| 自贡市| 孝昌县| 泽库县| 新兴县| 旬阳县| 济源市| 海安县| 蒙山县| 尼勒克县| 定安县| 黄陵县| 读书| 海门市| 祁连县| 青神县| 隆子县| 陆河县| 威海市| 汪清县| 尖扎县| 繁峙县| 沂南县| 马龙县| 阳城县| 连江县| 邻水| 德安县| 保康县| 石阡县| 诸暨市| 栖霞市| 漳浦县| 孝义市| 锡林浩特市| 台东县| 工布江达县| 蒙山县| 赤壁市| 彭泽县|