swan.stopDeviceMotionListening

基础库 3.30.2 开始支持,低版本需做兼容处理。

解释:停止监听设备方向的变化。

方法参数

Object object

object 参数说明

属性名类型必填默认值说明

success

Function

接口调用成功的回调函数

fail

Function

接口调用失败的回调函数

complete

Function

接口调用结束的回调函数(调用成功、失败都会执行)

示例

跳转编辑工具

在开发者工具中打开

在 WEB IDE 中打开

扫码体验

代码示例

百度智能小程序

请使用百度APP扫码

图片示例

swan.stopDeviceMotionListening - 图2

代码示例

  • SWAN
  • JS
  1. <view class="wrap">
  2. <view class="card-area">
  3. <view class="list-area border-bottom" s-for="item in infoList">
  4. <text class="list-item-key-4">{{item.chineseName}}</text>
  5. <text class="list-item-value">{{item.value}}</text>
  6. </view>
  7. <view class="button-group">
  8. <button bind:tap="stopDeviceMotionListening" disabled="{{!disabled}}" type="primary" hover-stop-propagation="true">停止监听</button>
  9. <button bind:tap="startDeviceMotionListening" disabled="{{disabled}}" type="primary" hover-stop-propagation="true">开始监听</button>
  10. </view>
  11. </view>
  12. </view>