Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add padding between label and its border

Tags:

ios

swift

iphone

I have in my swift application some labels that should have border. I added border to my label but I want to have more spaces between the label and its border.

How can I do that?

like image 732
Ne AS Avatar asked Dec 19 '22 12:12

Ne AS


1 Answers

Try this:

myLabel.frame.size.width = myLabel.intrinsicContentSize.width + 10
myLabel.frame.size.height = myLabel.intrinsicContentSize.height + 10
myLabel.textAlignment = .center
like image 87
Rob Avatar answered Dec 24 '22 02:12

Rob