iOS 获取、设置屏幕亮度
2020-07-20 本文已影响0人
狂暴的小蜗牛
获取当前屏幕的亮度
CGFloat lightValue = [UIScreen mainScreen].brightness;
//设置亮度大小 设置范围:0.1 -1.0
[[UIScreen mainScreen] setBrightness:0.6];
//设置屏幕常亮
[UIApplication sharedApplication].idleTimerDisabled = YES;
获取当前屏幕的亮度
CGFloat lightValue = [UIScreen mainScreen].brightness;
//设置亮度大小 设置范围:0.1 -1.0
[[UIScreen mainScreen] setBrightness:0.6];
//设置屏幕常亮
[UIApplication sharedApplication].idleTimerDisabled = YES;