Text Fields not centering on android

Hello, I've noticed that text fields don't align to center on android, even if you set the TextFieldAlign property to CENTER. I have tried the following methods and none of them seem to work: format = new TextFormat(font.fontName, defaultFontSize, 0xFF…

Viewing 1 to 2 (2 Total)
Text Fields not centering on android

Ceraph1216

Ceraph1216
Total Posts: 37
Joined: January 04, 2012

Hello, I've noticed that text fields don't align to center on android, even if you set the TextFieldAlign property to CENTER. I have tried the following methods and none of them seem to work:

format = new TextFormat(font.fontName, defaultFontSize, 0xFFFFFF, CENTER);

format = new TextFormat(font.fontName, defaultFontSize, 0xFFFFFF);
format.align = TextFormatAlign.CENTER;

debugTextField.autoSize = TextFieldAutoSize.CENTER;

Has anyone else run into this issue and found a method that works?

P.S. I have tried this using the nme.text and gm2d.text libraries.

Thanks!
~ Ceraph

Tags:
Posted on July 18, 2012 at 7:58 PM

singmajesty

singmajesty
Total Posts: 2147
Joined: August 25, 2011

Re: Text Fields not centering on android

What happens if you do not set auto size, but instead increase the size of your TextField manually? Does the text align center within the size of your field?

Posted on July 19, 2012 at 1:01 PM