In my iOS program, I want to set UILabel size in dp's. So that when the iOS device changes, according to scale factor (@1x, @2x, or @3x) my UILabel size will also changes proportionally.
在我的iOS程序中,我想在dp中设置UILabel大小。因此,当iOS设备发生变化时,根据比例因子(@ 1x,@ 2x或@ 3x),我的UILabel大小也会按比例变化。
Lets say for eg. @1x scale factor, I have UILabel size = 15pt, then It will automatically become 30pt @2x and 45pt @3x
让我们说,例如。 @ 1x比例因子,我有UILabel大小= 15pt,然后它将自动变为30pt @ 2x和45pt @ 3x
1 个解决方案
#1
1
I am not sure whether you can set UILabel size in dp's but instead what you can do is set "Autoshink" to "Minimum Font Size" and provide minimum desire font.
我不确定你是否可以在dp中设置UILabel大小,而是你可以做的是将“Autoshink”设置为“Minimum Font Size”并提供最小的字体。