收藏
回答

调用wx.setScreenBrightness,设置屏幕亮度,用IPHONE X真机调试有问题?

var screenbright=0.5

getScreenBrightness:function(){

wx.getScreenBrightness({

success(res){

console.log("screenbrightness",res)

screenbrightness:res.value

}

})

},

/**setScreenBrightness

  * 真机测试不稳定

  */

setScreenBrightness:function(){

var temp=screenbrightness+0.1

screenbrightness=temp

wx.setScreenBrightness({

value: (temp>1?1:temp),

success(res){

console.log("setScreenBrightness",res)

}

})

},

screenbrightness {value: 0.25147944688796997, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.6000000238418579, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.699999988079071, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.800000011920929, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.8999999761581421, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 1, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 1, errMsg: "getScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.2415519505739212, errMsg: "getScreenBrightness:ok"}

index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"}

index.js:14 screenbrightness {value: 0.2415519505739212, errMsg: "getScreenBrightness:ok"}


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签