gpt4 book ai didi

iphone - position 和 positionInPixels 有什么区别

转载 作者:行者123 更新时间:2023-11-28 18:41:22 25 4
gpt4 key购买 nike

过去我总是看到名为positionpositionInPixels 的属性是相同的。这次 position * 2 == positionInPixels。谁能告诉我这两个属性之间有什么区别,或者它们的值何时会不同?

最佳答案

position 以点为单位,positionInPixels 以像素为单位。在非视网膜设备上,1 点 = 1 像素。在 iPhone 4/4S 和 New iPad 等 Retina 设备上,1 点 = 2 像素。

根据 iOS Human Interface Guidelines :

Note: Pixel is the appropriate unit of measurement to use when discussing the size of a device screen or the size of an icon you create in an image-editing application. Point is the appropriate unit of measurement to use when discussing the size of an area that is drawn onscreen.

On a standard-resolution device screen, one point equals one pixel, but other resolutions might dictate a different relationship. On a Retina display, for example, one point equals two pixels.

See "Points Versus Pixels" in View Programming Guide for iOS for a complete discussion of this concept.

关于iphone - position 和 positionInPixels 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10478235/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com