I need to set constraints on the title text of my application such that the font size of the text is relative to that of the superview. This would help the text to vary with the screen size.
Found how to do so.
So what I did was:
@IBOutlet weak var iXyloTitle: UILabel!
iXyloTitle.font = iXyloTitle.font.withSize(self.view.frame.height * 0.031)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.