代码之家  ›  专栏  ›  技术社区  ›  Oren Mazor

iPhone 4分辨率

  •  1
  • Oren Mazor  · 技术社区  · 14 年前

    这不应该更高吗?还是我错过了什么?

    4 回复  |  直到 12 年前
        1
  •  3
  •   Sharjeel Aziz    13 年前

    Points Versus Pixels 在这方面是一个很好的读物:

    在iOS中,您指定的坐标之间存在差异 您的绘图代码和基础设备的像素。使用时 本地绘图技术,如Quartz、uikit和Core动画, 使用逻辑坐标空间指定坐标值,其中 以点为单位测量距离。这个逻辑坐标系是 与系统使用的设备坐标空间分离 用于管理屏幕上像素的框架。系统 自动将逻辑坐标空间中的点映射到中的像素 设备坐标空间,但此映射并不总是 一对一。这种行为导致了一个重要的事实,你应该 始终记住:

    一个点不一定对应于屏幕上的一个像素。

        2
  •  2
  •   John Rudy    14 年前

    You missed something. This is described in the WWDC "What's New Cocoa Touch" session (Session 101), if I recall correctly. (If you're a registered developer, you can download those on iTunes University.)

    They kept the dimension reporting the same to ensure that apps scaled correctly in both iPhone 4 and iPhone 3/3G/3Gs. 1 point is no longer 1 pixel.

    (孩子,我希望我不只是破坏了保密协议。)

        3
  •  0
  •   esreli    13 年前

    Both retina and standard pixel displays use the same point system even with different screen resolutions. For example, this is why on iPhone - when asking the window.frame.size.. - returns 320X480, even when the iPhone has a retina display. iOS puts the image in place according to the point grid regardless of image resolution. That image resolution might as well be able to handle either standard or retina displays.

    因此,始终创建视网膜像素显示的图像大小。

    请随意打印 定制绘图纸 (包括尺寸和常用组件)以帮助绘制视图草图(并非所有操作都应以数字方式完成:d)。 http://achim.us/eli/iOS_Graph_Paper.pdf

        4
  •  0
  •   Pawan Sharma    12 年前
    NSLog(@"%f", [[UIScreen mainScreen] scale]);
    

    以上声明将打印2个iPhone 4S、iPhone-5和1个iPhone 4或之前型号的iPhone。