1

I've seen a lot of iPhone apps that will dim the screen with an activity indicator when it's updating or downloading something to let the user know it's busy. I know how to do the activity indicator but how do I go about doing the dimming? Please post example code if you can.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Xcoder
  • 1,041
  • 5
  • 17
  • 29

2 Answers2

7

They don't actually dim it, Apple won't allow apps to adjust the screen brightness. They just put a black, semitransparent image over the screen, which has a similar effect.

Edit:

Jailbroken applications can adjust the screen brightness, and there is an API to do it, however Apple will not approve of any application that changes the screen brightness.

Community
  • 1
  • 1
Malfist
  • 31,179
  • 61
  • 182
  • 269
  • To clarify, you should use a separate, semitransparent black view rather than altering the drawing of the main view(s). This will be composited cheaply in the GPU. – Jens Ayton May 27 '09 at 18:12
2

Ok, the way I did this was too create another view and set the opacity very low. Then I add this view as a subview.

Xcoder
  • 1,041
  • 5
  • 17
  • 29