Question

In the iPhone app that I am currently developing, I present several "alert" views that mimic the behaviour of UIAlertView and UIActionSheet. These views require non-standard elements that are not available in UIAlertView or UIActionSheet. Rather than attempt to subclass either, I have created my own classes so that I can easily customize the look and feel of the alerts.

The one problem I am having with this is that I am having trouble fading the iPhone screen when the alert views are presented. I would like to fade out the whole screen (including the status bar) when presenting my custom views in the same way that UIAlertView and UIActionSheet do. I am trying to accomplish this by overlaying a semi-transparent view over the whole screen, but regardless of whether I add the view as a subview of the keyWindow or the topmost view, the status bar never gets shaded.

Does anyone have any suggestions on how to accomplish this? This seems like something that should be simple to do, so I'm probably overlooking something.

Was it helpful?

Solution

I haven't done this, but if you want to overlay anything over the status bar, I'd say you'll have to create a UIWindow instance and set its windowLevel to UIWindowLevelStatusBar. Or find the status bar window in the view hierarchy and add a semi-opaque subview to it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top