以编程方式更改iphone屏幕的亮度?

时间:2012-09-06 11:51:50

标签: iphone objective-c ios5

  

可能重复:
  Is there a way of adjusting the screen brightness programmatically?
  iPhone: How can we programmatically change the brightness of the screen?

我们如何通过触摸事件以编程方式更改(减少和增加)iphone屏幕的亮度?

1 个答案:

答案 0 :(得分:1)

可以使用Float值0 - 1来执行此操作,例如:

[[UIScreen mainScreen] setBrightness: 0.5f];