デバイスがiPhone4またはiPhone5の場合、FirstViewController
私はバックグラウンドを切り替えるためにこのコードを書きました:
ファイル名: bg-for5-568@2x.png
bg-for4@2x.png
bg-for4.png
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *backgroundImage = [[UIImage alloc] init];
if([[UIScreen mainScreen]bounds].size.height == 568)
{
backgroundImage = [UIImage imageNamed:@"bg-for5-568h"];
}
else
{
backgroundImage = [UIImage imageNamed:@"bg-for4"];
}
self.view.backgroundColor = [[[UIColor alloc] initWithPatternImage:backgroundImage] autorelease];
[backgroundImage release];
}
シミュレーターでアプリを起動すると、iphone5 の背景が 2 倍のサイズで表示されなくなります。
/* 解決しました ありがとうございます */