lundi 9 mars 2015

Adjusting UILabel size and text position after calling sizeToFit


Vote count:

0




Current result:


Current result


I'm able to adjust the size of the label by calling sizeToFit, which does a decent job at framing the text -- however, even with NSTextAlignmentCenter, the text is not exactly centered horizontally or vertically. To adjust the text positioning within the label, I've overridden drawTextInRect: to adjust the text rect using UIEdgeInserts.


Intended result:


enter image description here


Now that the text is centered, I'd like to expand the label to add some space between the text and the label edges. Any help would be greatly appreciated, thanks!



asked 2 mins ago







Adjusting UILabel size and text position after calling sizeToFit

Aucun commentaire:

Enregistrer un commentaire