WeChat アプレット開(kāi)発ドキュメント
/ 微信小程序API 重力感應(yīng)
微信小程序API 重力感應(yīng)
wx.onAccelerometerChange(CALLBACK)
監(jiān)聽(tīng)重力感應(yīng)數(shù)據(jù),頻率:5次/秒
CALLBACK返回參數(shù):
示例代碼:
wx.onAccelerometerChange(function(res) { console.log(res.x) console.log(res.y) console.log(res.z) })