微信小程序开发-view视图组件
WeChat小程序交流(QQ群:769977169)
效果图示例:左中右排列、左右上右下排列、上左下右下排列。
xxx.wxml中的结构设置
<!--三栏布局:左、中、右-->
<view class='contentLeftCenterRight'><view class='itemSize red'>1</view><view class='itemSize green'>2</view><view class='itemSize blue'>3</view>
</view><!-- 三栏布局:左、上、下--><view class='contentRightTopButtom'><view class='itemSize red' bindtap='clickTap'>单击</view><view class='contentTopButtom'><view class='itemSize green' bindlongtap='longTap'>长按</view><view class='itemSize blue'>3</view></view>
</view> <!--三栏布局:上、左、右--><view class='contentTopLeftRight'><view class='itemSize red' style='color:white;text-align:center;line-height:50px;' bindtouchstart='touchStart' bindtouchend='touchEnd' bindtouchmove='touchMove' bindtouchcancel='touchCancel'>触摸手势</view><view class='contentLeftRight'><view class='itemSize green'>2</view><view class='itemSize blue'>3</view></view>
</view>
xxx.wxss中的样式设置
/* pages/modules/viewPage/view.wxss */
.contentLeftCenterRight{display: flex;justify-content: space-around;align-items: center;
}
.contentLeftCenterRight .itemSize{flex: 1; height:50px;color:white;text-align:center;line-height:50px;font-size:20px;
}.contentRightTopButtom{ display:flex;margin-top:20px;height:100px;
}.contentRightTopButtom>.itemSize{color:white;text-align:center;line-height:100px;font-size:20px;width: 100px;height:100px;
}
.contentTopButtom{flex: 1; display: flex; justify-content: space-around;align-items: stretch;flex-direction: column;
}
.contentTopButtom .itemSize{flex: 1; align-self: stretch;color:white;text-align:center;line-height:50px;font-size:20px;height:50px;
}.contentTopLeftRight{margin-top: 20px;display: flex;flex-direction: column;height: 100;
}
.contentTopLeftRight>.itemSize{flex: 1;height: 50px;
}
.contentLeftRight{flex: 1; display: flex;justify-content: space-around;align-items: stretch; flex-direction: row; height: 50px;
}
.contentLeftRight .itemSize{flex: 1;height: 50;
}.yellow{background-color: yellow;
}
.red{background-color: red;
}
.green{background-color: green;
}
.blue{background-color: blue;
}
微信小程序开发-view视图组件相关推荐
- 微信小程序开发之——map组件
一 概述 wx.getLocation获取用户当前位置信息 map组件的基础属性(显示带有方向的当前定位点,显示指南针,开启卫星图) map添加标记点marker 二 map使用-当前不是定位位置 2 ...
- 微信小程序开发:自定义组件-behaviors
1.什么是behaviors behaviors是小程序中,用于实现组件间代码共享的特性,类似于vue的"mixins". 2.behaviors的工作方式 每个behavior可 ...
- 微信小程序开发之向组件传值的三种方式
一. 直接传值 向组件custom-component传值的页面 <!--index.wxml--> <custom-component my-value="hello&q ...
- 微信小程序开发之——视图全屏显示
一 概述 本文介绍两种将view全屏显示的方式: 布局文件设置宽度和高度 代码中获取到屏幕的宽度和高度,设置到view上 二 布局设置宽高全屏 2.1 布局文件(index.wxml) <vie ...
- 微信小程序开发demo
前言 链接: https://pan.baidu.com/s/16j8WCMv2JrRK2OzwvMwZ1w 提取码: 34mp 我们之前对小程序做了基本学习: 1. 微信小程序开发07-列表页面怎么 ...
- 微信小程序开发系列二:微信小程序的视图设计
大家如果跟着我第一篇文章 微信小程序开发系列一:微信小程序的申请和开发环境的搭建 一起动手,那么微信小程序的开发环境一定搭好了.效果就是能把该小程序的体验版以二维码的方式发送给其他朋友使用. 这个系列 ...
- 微信小程序开发学习5(自定义组件)
微信小程序开发学习5(自定义组件) 1.学习目标 能够知道如何自定义小程序组件 能够知道小程序组件中behaviors的作用 能够知道如何安装和配置vant-weapp组件库 能够知道如何使用MobX ...
- 微信小程序开发学习4(视图与逻辑)
微信小程序开发学习4(视图与逻辑) 1.学习目标 能够知道如何实现页面之间的导航跳转 能够知道如何实现下拉刷新效果 能够知道如何实现上拉加载更多效果 能够知道小程序中常用的生命周期函数 2.页面导航 ...
- 微信小程序开发教程:项目五导航组件 课后习题
<微信小程序开发教程>主编/黄寿孟 易芳 陶延涛 湖南大学出版社 目录 一.单选题 二.多选题 三.判断题 四.填空题 五.简答题 简述如何动态设置窗口的背景色. 六.编程题 1.设计一款 ...
- wxml报错原因_微信小程序开发教程(八)视图层——.wxml详解
框架的视图层由WXMKL(WeiXin Markup language)与WXSS(WeiXin Style Sheet)编写,由组件进行展示. 对于微信小程序而言,视图层就是所有.wxml文件与.w ...
最新文章
- MMD_2b_NearestNeighborLearning
- linux i2c 设备 操作说明
- java ldap 登陆AD域 查找某个帐号 查找某个组织单位
- Visual Studio 2022 Preview 3和2019 16.11发布
- json传输二进制的方案【转】
- 三层神经网络实现手写字母的识别(基于tensorflow)
- stone 的 log4j配置详解
- matlab脑电信号特征提取,一种脑电信号实时特征提取方法与流程
- Verilog初级教程(18)Verilog中的函数与任务
- Servlet原理解析
- php把amr转换成mp3,php 微信amr转mp3的方法
- Windows下usb接口驱动技术(一)
- 顺丰速运中山php招聘信息_中山顺丰快递招聘
- Flutter流畅性fps计算
- 见山只是山 见水只是水——提升对继承的认识
- 决策树概述+模块介绍+重要参数(criterion+random_statesplitter+减枝参数+目标权重参数)+回归树(参数+实例+拟合正弦曲线)+泰坦尼克号生存者预测实例
- 关于IPv6(超详细讲解)
- 如何删除ActiveX控件
- Mac OSX常用软件
- TLS/SSL双向认证
热门文章
- 第四章 Centos7.5下LVM操作与磁盘配额
- 云计算是什么?新手学习云计算的学习路线
- 安徽汽车网程序员删库跑路?安徽汽车官网只剩3张图片!
- 神经网络的相关函数以及误差类型
- 在 Windows 下关闭135/139/445端口的图文方法
- protel DXP2004批量修改
- 一文让你彻底弄清failfast、failsafe、failover、failback、failsilent
- 为什么计算机没有桌面显示不出来,我的电脑桌面不显示“我的电脑”了,请问怎么调出来?谢谢...
- 用低代码+BPM赋能知识文档管理系统
- tkinter制作选择文件夹对话框