0

as we know in iOS 7 the status bar overlaps with a view but not in iOS 6 .

I developed whole application for iOS7 and now I being asked to make iOS6 support for it but it is just a mess.

as we see in this Overlaps the status bar on view iOS7 question there is solution for iOS 7 to be like iOS6

but can I make it opposite way ? and somehow make iOS 6 behave like iOS7 with status bars ?

Community
  • 1
  • 1
Coldsteel48
  • 3,482
  • 4
  • 26
  • 43

2 Answers2

1

You can't make iOS 6 status bar act like iOS 7 status bar they are completely different designs. iOS 7 uses a flat UI whilst iOS 6 doesn't. Have a read through the iOS 7 transition guide for a better understanding and how to handle the differences.

To be specific towards the Status bar here is the section of that document that tells you how to handle it.

Popeye
  • 11,839
  • 9
  • 58
  • 91
1

Short Answer: No you can't.

iOS 6 SDK does not let you to control the status bar like iOS 7 does.

What you can do is adapt the size so it does not lose any structure in your actual layout

First you can define a constant to know when it is iOS 7 or not:

#define kIS_IOS_7 (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)

then in your AppDelegate you can change the navigation bar appearence like this:

UIView *background = [[UIView alloc] init];
if (kIS_IOS_7) {
    background.frame = CGRectMake(0, 0, 360, 64);
} else {
    background.frame = CGRectMake(0, 0, 360, 44);
}
background.backgroundColor = [UIColor blackColor]; // choose your color or image
UIGraphicsBeginImageContext(background.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[background.layer renderInContext:context];
UIImage *backgroundImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

[[UINavigationBar appearance] setBackgroundImage:backgroundImage
                                   forBarMetrics:UIBarMetricsDefault];
Andre Cytryn
  • 2,506
  • 4
  • 28
  • 43
  • so i cant make status bar to be transperent and to move my whole view bounds origin y to -20 ? – Coldsteel48 Dec 12 '13 at 13:36
  • @user2957713 Not on iOS 6 no sorry. I the guide I have provide they include all the questions that you may have in regards to supporting both iOS 6 and iOS 7. And there are some musts and shoulds in there that you may want to read through if supporting both. – Popeye Dec 12 '13 at 13:37
  • Ok , seems like I will have hard times with it :( Thanks for you answer – Coldsteel48 Dec 12 '13 at 13:52
  • Oh , btw I dont use navigation bar (not went well with the application designers) , how can I change background color of the status bar ? – Coldsteel48 Dec 12 '13 at 13:54
  • You can't change the color of the status bar. Well except for changing it from light (Grey) to default (black) or black using `UIStatusBarStyleDefault` or `UIStatusBarStyleLightContent` you can't go making it red are anything in iOS 6. Do you want to know in iOS 7 as well? – Popeye Dec 12 '13 at 13:57
  • I want it white. can you please paste code example of changing it to gray ? – Coldsteel48 Dec 12 '13 at 14:09
  • no , in iOS7 I want to use it as is , but I will use macro from [link](http://stackoverflow.com/questions/7848766/how-can-we-programmatically-detect-which-ios-version-is-device-running-on) to get current iOS version and will trim something there and change the view to be close to iOS7 – Coldsteel48 Dec 12 '13 at 14:12