有必要根据从光传感器接收到的数据来更改显示亮度,请帮忙。
public void OnSensorChanged(SensorEvent s)
{
if (s.Sensor.Type == SensorType.Light)
{
System.Diagnostics.Debug.WriteLine("Brightness" + s.Values[0]);
}
}
答案 0 :(得分:0)
您可以使用WindowManager更改亮度
Window.Attributes.ScreenBrightness = 0.0
// value of less than 0, the default, means to use the preferred screen brightness.
// 0 to 1 adjusts the brightness from dark to full bright.
// [Android Documentation]