All answers look like working, but in iOS6.0 I have the following problems:
1 / Spins look bad
2 / Window (status bar is a window view) required by rootViewController
I am using the answer from myell0w , but the rotation does not work very well. I simply remove one additional window and use the UIWindow from AppDelegate to create the status bar. Maybe this solution is approved for only one UIViewController application ...
Ive implemented as follows:
1 / In ApplicationDelegate:
self.window.windowLevel = UIWindowLevelStatusBar + 1; self.window.backgroundColor = [UIColor clearColor]; self.window.rootViewController = _journalController;
2 / Create a custom UIView and implement everything you need: As an example, you can see the status bar:
@interface LoadingStatusBar : UIControl
And easily create and add to the controller view:
_loadingBar = [[LoadingStatusBar alloc] initWithFrame:topFrame]; [self addSubview:_loadingBar];
3 / Magic when adding a controller view (in initWithFrame :)
CGRect mainFrame = self.bounds; mainFrame.origin.y = 20; self.bounds = mainFrame;
In your view of the controller there will be 2 types - viewing the contents and displaying the status bar. You can show the status bar or hide it whenever you want. The content viewing frame will be:
_contentView.frame = CGRectMake(0, 20, self.bounds.size.width, self.bounds.size.height);
4 / And one last magic here :) To detect touches in an insensitive area, I used:
-(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if (point.y < 20) return _loadingBar; return [super hitTest:point withEvent:event]; }
At the moment, it works great on the iPad / iPhone and all iOS from 4 to 6.