I’m developing a Delphi FMX application for iOS and I need to draw UI elements with a real physical size, for example a rectangle measuring exactly 3 cm × 3 cm on screen.
On Android this is relatively straightforward because DisplayMetrics exposes densityDpi, but on iOS I only see APIs such as:
UIScreen.mainScreen.scale
UIScreen.mainScreen.bounds
UIScreen.mainScreen.nativeBounds
From what I understand, scale is only the logical Retina scaling factor (2x/3x), not the actual physical PPI/DPI of the display.
Questions:
-
Is there any public iOS API to retrieve the real physical screen PPI/DPI?
-
If not, what is the recommended way to draw UI elements with a real-world physical size (cm/mm)?
-
Is maintaining a device-model → PPI lookup table the only solution?
-
How do professional iOS apps handle this problem?
Example:
// Goal: draw a rectangle exactly 3 cm × 3 cm
I would appreciate clarification on the recommended iOS approach here.