iOS以编程方式获取物理屏幕大小?
问题描述:
这可能吗?我想要的是英寸数,而不是像素数。我知道它大概是160 ppi。但不完全是。
Is this possible? I want the number of inches, not the number of pixels. I know it is approximately 160 ppi. But not exactly.
答
如果它可用,它将在 UIScreen 或 UIDevice 但它不存在。
If it were available it would be in UIScreen or UIDevice but it is not there.
您可以在 Erica的UIDevice-中从信息中推断出来 - 扩展名和维基百科上列出的每个设备的规格。
You can infer it from info in Erica's UIDevice-extension and the specs for each device listed here on Wikipedia.