Font size in pixels

前端 未结 7 634
陌清茗
陌清茗 2020-11-29 17:14

On an iPhone how do I calculate the size of a character in pixels for a given point size?

7条回答
  •  天命终不由人
    2020-11-29 17:52

    I believe you're looking for the UIFont NSString extensions that allow you to calculate the size of a string given a UIFont.

    Here is the Link

    Specifically the sizeWithFont methods.

提交回复
热议问题