微信小程序开发 -- 设置屏幕亮度

时间:2018-05-07 00:47:01   收藏:0   阅读:713

wx.setScreenBrightness(OBJECT)

设置屏幕亮度。

OBJECT参数说明:

参数类型必填说明
value Number 屏幕亮度值,范围 0~1,0 最暗,1 最亮
success Function 接口调用成功
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)
 


// 保持屏幕常亮 wx.setKeepScreenOn({ keepScreenOn: true })

 

  

// 设置屏幕亮度为最暗
 wx.setScreenBrightness({
 value: 0
 })

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!