修改屏幕亮度
// 手滑动左边部分修改的是亮度
if ((firstPoint.y - secondPoint.y) > 0) {
// 增加亮度
if ([UIScreen mainScreen].brightness < 1.0) {
[[UIScreen mainScreen] setBrightness:[UIScreen mainScreen].brightness = [UIScreen mainScreen].brightness + 0.025];
}
}else {
// 降低亮度
if ([UIScreen mainScreen].brightness > 0.0) {
[[UIScreen mainScreen] setBrightness:[UIScreen mainScreen].brightness = [UIScreen mainScreen].brightness - 0.025];
}
if ((firstPoint.y - secondPoint.y) > 0) {
// 增加亮度
if ([UIScreen mainScreen].brightness < 1.0) {
[[UIScreen mainScreen] setBrightness:[UIScreen mainScreen].brightness = [UIScreen mainScreen].brightness + 0.025];
}
}else {
// 降低亮度
if ([UIScreen mainScreen].brightness > 0.0) {
[[UIScreen mainScreen] setBrightness:[UIScreen mainScreen].brightness = [UIScreen mainScreen].brightness - 0.025];
}
}
posted on 2015-12-04 17:22 taiyang2014 阅读(238) 评论(0) 编辑 收藏 举报