Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes size for non portrait launch apps. Refs #26.

The statusBarFrame can't be trusted to initialize the status bar overlay
properly due to transformed rect coordinates. So we detect the
orientation and use the longest size with a predefined height.
  • Loading branch information...
commit 548afd9cbec17f210b902d4c592d1419da58a7c1 1 parent e7a6055
Grzegorz Adam Hankiewicz authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 DCIntrospect/DCStatusBarOverlay.m
11 DCIntrospect/DCStatusBarOverlay.m
View
@@ -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];
Please sign in to comment.
Something went wrong with that request. Please try again.