swift – What’s the distinction between UIScreen.scale and UIScreen.nativeScale in iOS?
[ad_1]
What’s the distinction between them? I get the identical worth on a regular basis.
For instance, with the code under:
UIScreen *display = [UIScreen mainScreen];
const QRectF bounds = QRectF::fromCGRect(display.bounds);
const QRectF native_bounds = QRectF::fromCGRect(display.nativeBounds);
const double scale = display.scale;
const double native_scale = display.nativeScale;
qDebug() << "bounds: " << bounds << ", native bounds: " << native_bounds << ", scale: " << scale << ", native scale: " << native_scale;
I get
bounds: QRectF(0,0 428x926) , native bounds: QRectF(0,0 1284x2778) , scale: 3 , native scale: 3
on iPad Professional simulator.
[ad_2]