Cocoa-Matic

iPhone, iPod touch, iPad tutorials, examples and sample code. Come and get it!

Wednesday, January 26, 2011

UITextField horizontal and vertical alignment

Horizontal alignment in a UITextField was quick and easy to find:
myTextField.textAlignment = UITextAlignmentLeft;
myTextField.textAlignment = UITextAlignmentCenter;
myTextField.textAlignment = UITextAlignmentRight;

Vertical alignment in a UITextField is equally as easy, just a little harder to find:
myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;
myTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;

Enjoy!

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home


« Older Entries  
Newer Entries »