微信小程序 View组件详细介绍

高洛峰
Release: 2017-02-23 15:10:57
Original
2142 people have browsed it

这篇文章主要介绍了微信小程序 View组件详细介绍的相关资料,需要的朋友可以参考下

微信小程序 View组件详细介绍

刚看到这个效果的时候还真是和ReactNative的效果一致,属性也基本的一样.

view这个组件就是一个视图组件使用起来非常简单。

主要属性:

flex-direction: 主要两个特性”row”横向排列”column”纵向排列

justify-content 主轴的对齐方式(如果flex-direction为row则主轴就是水平方向)

可选属性 (‘flex-start', ‘flex-end', ‘center', ‘space-between', ‘space-around')

align-items 侧轴对齐方式如果flex-direction为row则侧轴就是垂直方向)

可选属性 (‘flex-start', ‘flex-end', ‘center')

wxml



 
  view
  弹性框模型分为弹性容器以及弹性项目。当组件的display为flex或inline-flex时,该组件则为弹性容器,弹性容器的子组件为弹性项目。
 
 
  
   flex-direction: row
   
    
    
    
   
  
  
   flex-direction: column
   
    
    
    
   
  
  
   justify-content: flex-start
   
    
    
    
   
  
  
   justify-content: flex-end
   
    
    
    
   
  
  
   justify-content: center
   
    
    
    
   
  
  
   justify-content: space-between
   
    
    
    
   
  
  
   justify-content: space-around
   
    
    
    
   
  
  
   align-items: flex-end
   
    
    
    
   
  
  
   align-items: center
   
    
    
    
   
  

  
   align-items: center
   
    
    
    
   
  

 
Copy after login


wxss


.flex-wrp{
 height: 100px;
 display:flex;
 background-color: #FFFFFF;
}
.flex-item{
 width: 100px;
 height: 100px;
}
Copy after login

更多微信小程序 View组件详细介绍相关文章请关注PHP中文网!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!