前言

更多内容,请访问我的 个人博客。


微信小程序如何获取屏幕的高度和宽度

  • 方法一:
var windowHeight = wx.getSystemInfoSync().windowHeightvar windowWidth = wx.getSystemInfoSync().windowWidth
  • 方法二:
.windowHeightWidthClass {    height: 100vh;    width: 100vw;}

CSS3中的 vh 和 vw 是相对于屏幕大小的单位,即:
vh = view height
vw = view width


小程序

TAG标签: 微信小程序屏幕使用时间

http://www.xiaochengxub.com/read-100782.html