@eagle.dan.1349の回答のおかげで、アイデアを思いつきました。ナビゲーションバーの背景の高さを拡張してステータスバーの高さを含めてから、背景の画像を下から下からスペースを離れることを開始します。ステータスバーの場合:
+ (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;
}
そして出来上がり、それは魅力のように機能します!私のようなiOS 6のステータスバースタイルを保持しようとしている人にとって、これが何らかの形で役立つことを本当に願っています。