资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

小程序中如何实现view视图容器

小编给大家分享一下小程序中如何实现view视图容器,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都做网站、成都网站设计、绥德网络推广、重庆小程序开发公司、绥德网络营销、绥德企业策划、绥德品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供绥德建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com

具体如下:

视图容器

// wxml

 flex-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;
}

小程序中如何实现view视图容器

图片

// wxml

 flex-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;
}

小程序中如何实现view视图容器

图片

// wxml

 justify-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视图容器

view

// wxml

 justify-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视图容器

view

// wxml

 justify-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视图容器

view

// wxml

 justify-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视图容器

view

// wxml

 justify-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视图容器

view

// wxml

 justify-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视图容器

view

属性

排列方式(flex-direction)描述
row横向排列
column纵向排列
项目内容对齐(justify-content)描述
flex-start向行头紧挨
flex-end向行尾紧挨
center居中紧挨
space-between平均分布
space-around平均分布 ,两边留有一半间隔
space-evenly两边间隔与中间相同

源码

// wxml

 flex-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;
}

以上是“小程序中如何实现view视图容器”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!


名称栏目:小程序中如何实现view视图容器
链接地址:http://cdkjz.cn/article/jedhjd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220