Vertically align text within a UILabel

I’ll make my label in code so that you can see what’s going on. You can set up most of this in Interface Builder too. My setup is a View Based App with a background image I made in Photoshop to show margins (20 points). The label is an attractive orange color so you can see what’s going on with the dimensions.

Some limitations of using sizeToFit come into play with center- or right-aligned text. Here’s what happens:

 

This entry was posted in iPhone Development and tagged by Nimit Parekh. Bookmark the permalink.

About Nimit Parekh

Hey ! I am Nimit S. Parekh a passionate mobile application developer from India.. I am always hunting for better knowledge in iOS. I am looking forward to be a good app & game developer. I keep on sharing my knowledge @ http://sugartin.info as soon as I get spare time for it. I would love to hear your personal feedback about this blog.

Leave a Reply

Your email address will not be published. Required fields are marked *



*