1

3.5インチで走ると、ゲームがうまく動きます。このような: ここに画像の説明を入力

アップグレード前、4.0インチでの走行も良好。次のようなコード:

#import <Foundation/Foundation.h>

@interface UIImage(iPhone5Extension)

+ (UIImage *)imageNamedWithiPhone5:(NSString *)name imageTyped:(NSString *)type;

@end

#import "UIImage+iPhone5.h"

@implementation  UIImage(iPhone5Extension)

+ (UIImage *)imageNamedWithiPhone5:(NSString *)name imageTyped:(NSString *)type
{
    NSString *imgName = nil;
    if ([type length]==0) {
        type = @"png";
    } else {
        type = type;
    }
    if (IS_IPHONE5) {
        imgName = [NSString stringWithFormat:@"%@-568h",name];
    } else {
        imgName = name;
    }

    NSString *path = [[NSBundle mainBundle] pathForResource:imgName ofType:type];
    UIImage *image = [UIImage imageWithContentsOfFile:path];
    return image;
}

@end

次に ViewDidLoad で:

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.DefaultImageView.image = [UIImage imageNamedWithiPhone5: @"Title" imageTyped:@"png"];
}

ただし、3種類の写真があります: Title.png/Title@2x.png/Title-586h.png

でも最新のxCodeにアップグレードしたら3.5インチで動くのはいいのですが、4.0インチモードで動かしたらこんなイメージになりました…

ここに画像の説明を入力

何が起こったかわからない!!! では、どうすれば回復できますか (4 インチモードでも有効ですか?)

前もって感謝します!!!

4

0 に答える 0