HomeDocs
Skip to main content

dlt.setScreenBrightness

Introduction​

The dlt.setScreenBrightness function is used to set the screen brightness of the device.

Parameters​

Object object​

PropertyTypeDefault ValueRequiredDescription
screenBrightnessnumberYesThe screen brightness to set.
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function that is called when the API call is complete (whether successful or not).

The screenBrightness property can take values from 0 to 1, with 0 representing the lowest brightness and 1 representing the highest brightness. You can also use the special value -1 to indicate that the brightness should follow the system's automatic setting.

Example Code​

dlt.setScreenBrightness({
screenBrightness: 1,
});

In this example, the screen brightness is set to the maximum value (1).

Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.