Objective c 模拟器没有显示iPhone5的真实尺寸?

Objective c 模拟器没有显示iPhone5的真实尺寸?,objective-c,cocos2d-iphone,Objective C,Cocos2d Iphone,我正在xcode上尝试在模拟器上运行我们的应用程序,并检查屏幕高度。 我正在使用cocos2d,但我也尝试过苹果的方法 NSLog(@"HEIGT:%f",[UIScreen mainScreen].bounds.size.height); //and also : winSize = [[CCDirector sharedDirector] winSize]; NSLog(@"HEIGT:%f",winSize.Height); 在iPhone5的

我正在xcode上尝试在模拟器上运行我们的应用程序,并检查屏幕高度。 我正在使用cocos2d,但我也尝试过苹果的方法

     NSLog(@"HEIGT:%f",[UIScreen mainScreen].bounds.size.height);

      //and also :
     winSize = [[CCDirector sharedDirector] winSize];
     NSLog(@"HEIGT:%f",winSize.Height);
在iPhone5的4英寸模拟版上,这两款手机的高度都达到了480。
为什么呢?我怎么知道这是不是真的iPhone5?

几天前,我遇到了同样的问题,解决方案是

为视网膜(4英寸)设置合适大小的启动图像


在您的项目中,拍摄一张尺寸为640*1136的图像,并添加到launch图像的视网膜图像中,您将获得实际尺寸。您也可以签入打印日志

2013-04-22 13:10:56.510 test[7526:c07] cocos2d: cocos2d v1.0.1
2013-04-22 13:10:56.511 test[7526:c07] cocos2d: Using Director Type:CCDirectorDisplayLink
2013-04-22 13:10:56.654 test[7526:c07] cocos2d: OS version: 6.1 (0x06010000)
2013-04-22 13:10:56.654 test[7526:c07] cocos2d: GL_VENDOR:   Apple Computer, Inc.
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_RENDERER: Apple Software Renderer
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_VERSION:  OpenGL ES-CM 1.1 APPLE
2013-04-22 13:10:56.655 test[7526:c07] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2013-04-22 13:10:56.656 test[7526:c07] cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
2013-04-22 13:10:56.656 test[7526:c07] cocos2d: GL_MAX_SAMPLES: 4
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports PVRTC: YES
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports BGRA8888 textures: YES
2013-04-22 13:10:56.657 test[7526:c07] cocos2d: GL supports NPOT textures: YES
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: GL supports discard_framebuffer: YES
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: compiled with NPOT support: NO
2013-04-22 13:10:56.658 test[7526:c07] cocos2d: compiled with VBO support in TextureAtlas : YES
2013-04-22 13:10:56.659 test[7526:c07] cocos2d: compiled with Affine Matrix transformation in CCNode : YES
2013-04-22 13:10:56.659 test[7526:c07] cocos2d: compiled with Profiling Support: NO
2013-04-22 13:10:56.708 test[7526:c07] cocos2d: Frame interval: 1
2013-04-22 13:10:56.709 test[7526:c07] Application windows are expected to have a root view controller at the end of application launch
2013-04-22 13:10:56.709 test[7526:c07] cocos2d: surface size: 320x568

这对我来说很好。

您添加了iphone 5 splash吗?-违约-568h@2x.png?查看这篇帖子:谢谢,这很有效。但如果我不想在加载时添加默认图像呢?如果您不能添加默认图像,则加载时会出现几秒钟的黑屏。