Add UIView Above All Other Views, Including StatusBar

Posted by Mike Stead on Stack Overflow See other posts from Stack Overflow or by Mike Stead
Published on 2010-04-19T11:00:52Z Indexed on 2010/04/19 11:03 UTC
Read the original article Hit count: 303

Filed under:
|
|

I'm wanting to create a view (UIControl) which blocks all input and shows a UIActivityIndicatorView while authenticating a user.

The UIActionSheet and UIAlertView both manage to add a black semi-transparent view over the top of all other views to block input and I'd like to do similar.

I've tried adding my view to the top UIWindow in the [[UIApplication sharedApplication] windows] array, and while this does place it above the UIKeyboard if it's visible, it doesn't place it over the StatusBar (which makes sense).

My next attempt was to extend UIAlertView, remove all of its subviews and set its layer.contents = nil, then add the ActivityIndicator as a subview. This works well, but I can't seem to kill the default bouncy transition of the UIAlertView when you call it to "show".

Does anyone have any pointers towards the best way tackle this problem that gives me full control?

Oh and I know blocking input is not great but I do ensure it's for a short period of time and it has the benefit of making it clear to the user that their action, which must complete for them to progress, is processing.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch