PDA

View Full Version : middle text in TextField



swisseuro
February 9th, 2009, 03:37 PM
how can i middle a text in the Textfield that is 100px by 100px

so that when i have 1 line its in the middle, when i have 2 lines its in the middle as well
check attachment.

when i do it right now it is always on the top

i basically would need the same as when i have a HTML table by default so it is horizontal in the middle.

http://www.vivaxone.com/grid/text.jpg

jwerre
February 9th, 2009, 05:41 PM
I don't thing there's a way to "middle" the text inside of a text field. What you can do is middle the textfield itself.



textField.y = myTextFieldContainer.height*.5 - textField.height*.5;