Tag Archives: UILabel

UILabel and text.

In an upcoming app, I put a couple UILabels on, and populate the text from a database.  I then rounded the corners to make it look nicer, and was able to get the labels to auto-size so they adjust according to how much text is in there.

However, even though rounded corners look nice, it makes the edges of the text cut off.

I spent quite some time online looking for a way to, say, expand the label text area by 20 points (kind of like pixels).  I found all kinds of ways to make an auto-sizing label in code, but I didn’t need that since I had already done that through the Xcode interface itself.

I gave up, and instead just added 3 spaces before and after what I add from the database, and it worked out perfectly.

Gotta remember K.I.S.S..  Keep It Simple Stupid.