一:testview.wxml,testview.js自动生成示例代码 //testview.wxml <view class="section"> <view class="section__title">flex-direction: row</view> <view class="flex-wrp" style="display:flex; flex-direction:row;"…
微信小程序 View 支持两种布局方式:Block 和 Flex 所有 View 默认都是 block 要使用 flex 布局的话需要显式的声明: display:flex; 下面就来介绍下微信小程序的 Flex 布局 先做一个简单的 demo <view class="main"> <view class="item item1">1</view> <view class="item item2">…
微信小程序实现标签页滑块效果 小程序完整代码: wxml: <view class="swiper-tab"> <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">留言</view> <view class="swiper-tab-lis…
日期:2019.2.25 博客期:036 星期一 吼!今天我还是继续研究了自己的微信小程序,还没有连接数据库,只是在xml的设计上添加了不少东西,大家可以看我的截图,嗯~说到今天的收获,就是 margin-top 来设置边距,相当的实用.我就想到之前的CSS设计里都没有使用这一方法,所以明天.后天想着赶紧去试一试吧! 今天还解决了一个很重要的问题——image标签使用错误 注; 1.标签的写法是<image />,类型是同 input 标签的,注意不要写成<image></i…
容器的概念,是用来包含其它容器(container)和项目(item). flex container——flex容器 A flexbox layout is defined using the flex or inline-flex values of the display property on the parent item. This element then becomes a flex container, and each one of its children becomes…
最近在做小程序,使用<text>标签的时候发现里面的文本text-family不生效, 经过试验,发现直接在text标签的class设置不生效,可以在外层包一个父元素就可以设置了. <view class="info"> <text class="text1">文本1</text> </view> .info{ width: 100%; height:640rpx; background: #fff; z-…
<view class="section"> <view class="section__title">flex-direction: row</view> <view class="flex-wrp" style="flex-direction:row;"> <view class="flex-item bc_green">1</view&…
刚看到这个效果的时候还真是和ReactNative的效果一致,属性也基本的一样. view这个组件就是一个视图组件使用起来非常简单. 主要属性: flex-direction: 主要两个特性”row”横向排列”column”纵向排列 justify-content 主轴的对齐方式(如果flex-direction为row则主轴就是水平方向) 可选属性 (‘flex-start’, ‘flex-end’, ‘center’, ‘space-between’, ‘space-around’) ali…
当 display: flex 配合 justify-content: center 使用时可以让view水平居中 而配合 align-items: center 用时可以实现垂直居中效果 .card-image-container{ width: 40%; height: 90%; align-items: center; /** 垂直居中*/ display: flex; justify-content: center; /** flex 属性, 水平居中**/ }    …
html 小程序 <div></div> <view></view> <h1><h2>....<h6> <p><span> <text></text> <input type="text"> <input type="checkbox"> <input type="radio">…