ユーザーの背景静的UIImageView
(Nib
ファイルから)のサイズを調整しようとしていiPhone5
ます。残念ながら、次のコードは背景ビューのサイズに何の違いもないようです。
誰かが理由を知っていますか?ご協力いただきありがとうございます。
ViewController.m:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
device = appDelegate.deviceType;
NSLog(@"The device platform is: %@", device);
if ([[device substringToIndex:8] caseInsensitiveCompare: @"iPhone 5"] == NSOrderedSame) {
[background sizeThatFits:CGSizeMake(320, 504)];
}
else {
[background sizeThatFits:CGSizeMake(320, 416)];
}
...
//Note: 'background' is declared in `ViewController.h` as, `IBOutlet` `UIImageView` *background, and is linked to the image view in ViewController_iPhone.xib