屏幕尺寸(以像素为单位)(iPhone 6)

时间:2022-11-11 12:25:38

According to the page here: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions the iPhone 6 screen size in pixels should be 750×1334 (1334x750 landscape) however my application seems to think the screen dimensions are 667/375 in landscape and it's not being rendered properly to the entire screen. Here's the code I'm using to get the window dimensions when the application launches as well as opengl.

根据这里的页面:http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions iPhone 6屏幕尺寸的像素应该是750×1334(1334x750风景)然而我的应用程序似乎认为横向屏幕尺寸为667/375,并且无法在整个屏幕上正确渲染。这是我用来获取应用程序启动时窗口尺寸以及opengl的代码。

applicationDidFinishLaunching:

在applicationDidFinishLaunching:

CGRect rect = [[UIScreen mainScreen] bounds];
CGFloat screenW = rect.size.width;
CGFloat screenH = rect.size.height;

initGL:

initGL:

CGRect rect = [glView bounds];
CGFloat screenW = rect.size.width;
CGFloat screenH = rect.size.height;
glOrthof(0, screenW, 0, screenH, -1, 1);

Both functions print out the same values: 667w/375h. Could this have to do with an issue I had with the splash image, where basically I had to rename it from Default-667h@2x.png to Default-375w-667h@2x.png to get it to load properly? I feel like this is something simple I'm missing here, any help is appreciated.

两个函数都打印出相同的值:667w / 375h。这可能与我在启动图像上遇到的问题有关,基本上我必须将它从Default-667h@2x.png重命名为Default-375w-667h@2x.png以使其正确加载?我觉得这很简单,我在这里缺少,任何帮助都表示赞赏。

1 个解决方案

#1


0  

It is is ok. What you see is logical points. These get translated into physical pixels. In case of iPhone 6 it is 2x.

没关系。你看到的是逻辑点。这些被转换为物理像素。对于iPhone 6,它是2倍。

#1


0  

It is is ok. What you see is logical points. These get translated into physical pixels. In case of iPhone 6 it is 2x.

没关系。你看到的是逻辑点。这些被转换为物理像素。对于iPhone 6,它是2倍。