Skip to content

Commit

Permalink
Merge pull request #30 from gradha/non_portrait_orientation_bug_secon…
Browse files Browse the repository at this point in the history
…d_try

Fixes size for non portrait launch apps. Refs #26.
  • Loading branch information
domesticcatsoftware committed Oct 11, 2011
2 parents 184747a + 548afd9 commit 5e786d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions DCIntrospect/DCStatusBarOverlay.m
Expand Up @@ -25,8 +25,15 @@ - (id)init
{
if ((self = [super initWithFrame:CGRectZero]))
{
self.windowLevel = UIWindowLevelStatusBar + 1.0f;
self.frame = [[UIApplication sharedApplication] statusBarFrame];
self.windowLevel = UIWindowLevelStatusBar + 1.0f;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
const CGFloat bar_size = 20;
if (UIInterfaceOrientationIsLandscape(orientation))
self.frame = CGRectMake(0, 0, screenHeight, bar_size);
else
self.frame = CGRectMake(0, 0, screenWidth, bar_size);
self.backgroundColor = [UIColor blackColor];

UIImageView *backgroundImageView = [[UIImageView alloc] initWithFrame:self.frame];
Expand Down

0 comments on commit 5e786d0

Please sign in to comment.