wx.getSystemInfoSync().windowWidth宽度为 0
发布于 6 年前 作者 phan 16225 次浏览 来自 问答

安卓手机 wx.getSystemInfoSync().windowWidth 获取设备宽度 为 0iOS正常;微信版本:  6.6.6,  6.6.7开发版本库: 2.1.1

```

onLoad: function (options) {

        var that = this;

        console.log(wx.getSystemInfoSync().windowWidth)

 

        that.setData({

            columnWidth: (wx.getSystemInfoSync().windowWidth - 22 - 13) / 2 + ‘px’

        })

    },

    ```手机调试打印出来 wx.getSystemInfoSync().windowWidth  是 0

1 回复

你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部