So thanks to @eagle.dan.1349's answer, I've come up with an idea: I extend the height of navigation bar background to include the height of the status bar, and then start drawing the background image from lower to leave the space for the status bar:
+ (UIImage *)createTopBar: (UIDeviceOrientation) orientation {
// Create a new image context
CGSize size;
if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight){
if ([UIDevice isiPhone5]) {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7){
size = CGSizeMake(568, 34);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(568, 54), NO, 0.0);
}
else {
size = CGSizeMake(568, 34);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(568, 34), NO, 0.0);
}
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
size = CGSizeMake(1024, 44);
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
}
else {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7){
size = CGSizeMake(480, 34);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(480, 54), NO, 0.0);
}
else {
size = CGSizeMake(480, 34);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(480, 34), NO, 0.0);
}
}
}
else{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
size = CGSizeMake(768, 44);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(768, 44), NO, 0.0);
}
else if ([UIDevice isiPhone5]) {
size = CGSizeMake(320, 44);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(320, 44), NO, 0.0);
}
else {
size = CGSizeMake(320, 44);
UIGraphicsBeginImageContextWithOptions(CGSizeMake(320, 44), NO, 0.0);
}
}
UIImage * image = [UIImage imageNamed: @"top_bar_without_title"];
if ((orientation == UIInterfaceOrientationLandscapeLeft ||
orientation == UIInterfaceOrientationLandscapeRight) &&
[[[UIDevice currentDevice] systemVersion] floatValue] >= 7){
[[UIColor blackColor] set];
UIRectFill(CGRectMake(0, 0, size.width, 40));
[image drawInRect:CGRectMake(0, 20, size.width, size.height+4)];
}
else {
[image drawInRect:CGRectMake(0, 0, size.width, size.height+4)];
}
UIImage * destImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return destImage;
}
And voila, it works like a charm! Really hope this could be somehow helpful for someone who's trying to hold on the iOS 6's status bar style like me.