Add UIView Above All Other Views, Including StatusBar
- by Mike Stead
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.