Sanket P Bhamre
Sanket P Bhamre

Reputation: 632

How to set UILabel font size in iOS in terms of dp's (Not in points) just like android with only autolayout

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.

Lets say for eg. @1x scale factor, I have UILabel size = 15pt, then It will automatically become 30pt @2x and 45pt @3x

Upvotes: 1

Views: 695

Answers (1)

Rokon
Rokon

Reputation: 375

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.

Select your label and assign Autoshrink under Label in Attribute inspector

Upvotes: 1

Related Questions