更新时间:2023-11-09 22:55:52
你应该设置图层的 contentsScale
与屏幕的比例
相同:
You should set the layer's contentsScale
to be the same as the scale
of your screen:
layer.contentsScale = [UIScreen mainScreen].scale;
这将在所有iOS设备,Retina Display和非Retina Display上正确缩放。除非你有充分的理由这样做,否则你不应该硬编码为2.0(或其他任何事情)。
This will scale it correctly on all iOS devices, Retina Display and non-Retina Display. You shouldn't hard-code it to 2.0 (or anything else for that matter) unless you have a good reason to do so.