How can I get the font size and font name of a UILabel?

前端 未结 4 1529
予麋鹿
予麋鹿 2020-12-23 08:53

I have a UILabel which I set a font size and a font name with Interface Builder. Now I have to read the values of both in my ViewController.

How can I do this?

4条回答
  •  再見小時候
    2020-12-23 09:41

    Pointsize value is not the Font Size of used in UIFont size property. Say if you go set interface builder font size to 14 and do a print of the pointSize you'll get only 11.

提交回复
热议问题