微信小程式開發(fā)文檔
/ 微信小程序API 重力感應(yīng)
微信小程序API 重力感應(yīng)
wx.onAccelerometerChange(CALLBACK)
監(jiān)聽重力感應(yīng)數(shù)據(jù),頻率:5次/秒
CALLBACK返回參數(shù):
示例代碼:
wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) console.log(res.z) })