I'm adding a custom status bar in my application to monitor upload progress. This works fine in portrait mode, but when I am in landscape and my custom status bar appears, it always appears on the opposite side of the home button. I think it's because I'm hard coding my frame.
I have the XIB file set to auto adjust its length.
take a look:
-(void) animateStatusBarIn {
float x = window.frame.origin.x;
float y = window.frame.origin.y;
float height = 20;
float width = window.frame.size.width;
CGRect statusFrame = CGRectMake(x, y-20, width, height);
iPadUploadStatusBar *statusView = [[iPadUploadStatusBar alloc] initWithNibName:@"iPadUploadStatusBar" bundle:nil];
self.status = statusView;
[statusView release];
status.view.frame = statusFrame;
[window addSubview:status.view];
[UIView beginAnimations:@"slideDown" context:nil];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished:)];
statusWindow.frame = CGRectMake(0.0f, 0.0f, 1024.0f, 20.0f);
[UIView commitAnimations];
}
All is good in portrait orientation, but like I said, it always decides that the new status bar should go opposite of the home button. Please help!!!
By the way, this is inside AppDelegate.m, so I'm using the existing window that's in the default appDelegate file Thanks