1.

首先获取适配器信息,用getSystemInfoSync()然后.windowHeight获取高度,.windowWindth获取宽度。

varsysInfowx.getSystemInfoSync();console.log(sysInfo);varwinHeightsysInfo.windowHeight;varwinLengthsysInfo.windowWidth;console.log(winHeight);console.log(winLength);2.

这个运行的结果是:

3.

我这个是iPhone6的适配,屏幕信息就console出来了,高为603宽为375。

4.

关键在于测量设备信息是用wx.getSystemInfoSync()。

TAG标签: 微信小程序测量手机屏幕大小微信有没有测量距离的小程序微信小程序ibeacon

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