RSS Feed!

Recent Posts

Recent Comments

iPhone how to: center and horizontal align the contents of a UITextField

It’s as simple as:

1
2
theTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
theTextField.textAlignment = UITextAlignmentCenter;

Basically this will ensure that no matter how tall your text field is the actual text will be centered both vertically and horizontally.

Cheers…

Tags: , ,

By Nick | 7. Aug 2009 | Objective C, iPhone | No Comments »

Leave a Reply