wx.getSystemInfoSync().windowWidth宽度为 0

发布于 8 年前作者 phan16334 次浏览最后编辑 8 年前来自 ask

安卓手机 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 回复
chao18
chao181 楼6 年前

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