0

I am currently working on an iOS 6 app. Running this application on iPhone 4/5 runs well. The only problem is that with the new iOS 7 coming out, the design are ruined. Status bar are now part of the app, and all the view in my application get push to the top, overlap with the status bar.

What is the best solution to resolve this issue? I am using UINavigationController and some custom view. Done some reading, some suggest that I include a custom container view to create something like iOS 6 'status bar', since the view at the top will be black and empty. Is there any other solution to this? Or maybe the right way to fix my apps to support both iOS 6 & 7 design?

Azuan
  • 878
  • 2
  • 13
  • 33

3 Answers3

1

There is a simplest solution for this. We have to Thank apple for this concept.

Checkout the solution below

  1. First of all in storyboard/xib change screen size to 4" from Utility Inspector window 4th tab
  2. Arrange your uicontrols according to the design (i.e start framing below the statusbar)
  3. Now go to 5th tab into Utility Inspector window
  4. You must have frame for your each control
  5. Turn your eyes below the frame and you can see the iOS6/7 Deltas
  6. In the DeltaY field reduce 20 pixels for each control. I mean fill up -20 in Delta Y field
  7. So now run your project with both iOS7 & 6 you will have what you want.

Note: You have to have uncheck the "Use Autolayout" in order to use delta

Enjoy Programming!!

Checkout Delta value for Y Position

Niru Mukund Shah
  • 4,637
  • 2
  • 20
  • 34
1

One solution that will allow you to:

  • Support both iOS6 and iOS7 as a deployment target.
  • Preserve your existing iOS6-style code, and defer the impact of a redesign

. . . is to add the following to your view controller:

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7"))
{
    self.edgesForExtendedLayout = UIRectEdgeNone;
}

. . since, I'm using code-based views, I add it in loadView, however it would also work in viewDidLoad

Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
-1

Try this in your AppDelegate.m in didFinishLaunching

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {

       [application setStatusBarStyle:UIStatusBarStyleLightContent];

       self.window.clipsToBounds =YES;

       self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
Chris Byatt
  • 3,689
  • 3
  • 34
  • 61
  • - 1 for: status bar not always 20px. On call or record event its more than 20px. (to try it use cmd (or ctrl) + T) – Evgeniy S Sep 26 '13 at 10:10