WeChat applet development -- set screen brightness

wx.setScreenBrightness(OBJECT)

Set screen brightness.

OBJECT parameter description:

parameter Types of Required illustrate
value Number Yes Screen brightness value, the range is 0~1, 0 is the darkest, 1 is the brightest
success Function no The interface call is successful
fail Function no Callback function for interface call failure
complete Function no The callback function of the end of the interface call (the call will be executed if it succeeds or fails)
 


// keep the screen always on wx.setKeepScreenOn({ keepScreenOn: true })

 

  

// Set the screen brightness to the darkest 
wx.setScreenBrightness({
 value: 0
 })

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325473935&siteId=291194637