0

在为 iOS 创建应用程序时,我不知道为什么,但我的所有图像都模糊且质量差。它们在 Photoshop 和 Xcode 中的预览中看起来很完美,但是在模拟器中并在我的实际设备(iPhone 5)上进行测试时,它们看起来很差而且模糊。它们是高分辨率图像,我已将它们制作为 640 x 1136 像素的 iPhone 图像尺寸。我还添加了标准图像和@2x。'这是他们在预览中的样子: 预览中的 iphone 5 图像

这就是它在模拟器(和我的设备上)中的样子。抱歉,由于我使用的是 Macbook Air 而不是 iMac,所以顶部被切断了。

模拟器上的图像

我正在通过以下代码加载我的图像:

        CGRect screenBounds = [[UIScreen mainScreen] bounds];
    if (screenBounds.size.height == 568) {
        CCSprite* background = [CCSprite spriteWithFile:@"background_light_iphone5.png"];
        background.position = ccp(160, 284);
        [self addChild:background];
    } else {
        CCSprite* background = [CCSprite spriteWithFile:@"background_light.png"];
        background.position = ccp(160, 240);
        [self addChild:background];
    }

任何帮助表示赞赏。谢谢你的时间。

4

0 回答 0