Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@gradha

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.

Grzegorz Adam Hankiewicz 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.
548afd9
@domesticcatsoftware domesticcatsoftware merged commit 5e786d0 into domesticcatsoftware:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 7, 2011
  1. Fixes size for non portrait launch apps. Refs #26.

    Grzegorz Adam Hankiewicz authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 DCIntrospect/DCStatusBarOverlay.m
View
11 DCIntrospect/DCStatusBarOverlay.m
@@ -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];
Something went wrong with that request. Please try again.