私のアプリの中には、カスタム画像を背景として使用しているものがあります。適切な画像を配置するために画面サイズを確認する適切な方法は何ですか?
viewDidLoad で次のようにする必要があります。
if ([UIScreen mainScreen] == 2.0)
{
UIImage * backgroundImage = [UIImage imageNamed:@"bgimage-568h@2x.png"];
backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]];
}
else
{
UIImage * backgroundImage = [UIImage imageNamed:@"bgimage.png"];
backgroundImageView = [[UIImageView alloc] iniWithImage:backgroundImage]];
}
どんなヒント/アドバイスも大歓迎です!
ありがとう!