Native Textfield Vertical Centering

Question for everyone. I have a native textfield whose height is greater than the font it is displaying. The default positioning of the text appears to be the upper left corner. I would like to center the text vertically within the textfield. Is there a way to accomplish this?

Thanks! [import]uid: 69863 topic_id: 12897 reply_id: 312897[/import]

There isn’t a simple way to “center it vertically”, no; it can be aligned to center, left or right but not on a Y value, I do not believe. [import]uid: 52491 topic_id: 12897 reply_id: 47677[/import]

Can you fix this bug?
It doesn’t look nice if I have to make the font as tall as the text field height.

Thanks. [import]uid: 67377 topic_id: 12897 reply_id: 53955[/import]

Hey there, not a bug.

See here for a possible solution (in the comments) - http://developer.anscamobile.com/code/auto-wrapped-text-updated#comment-52493

Peach :slight_smile: [import]uid: 52491 topic_id: 12897 reply_id: 54040[/import]

I have the same problem: the text (font size = 24) is misplaced in the TextField box (height = 35). On simulator, it’s placed lower than the bottom edge. On Android, it’s placed cross the top edge and only half is shown. That’s weird. I’m using the Version 2012.828.

userField = native.newTextField( 40, 170, 240, 35)
userField.inputType = “email”
userField.font = native.newFont( “HelveticaNeue-Bold”, 24 )

Christian and jstsun, have you figure out a solution?

Thanks a lot for any suggestion. [import]uid: 95688 topic_id: 12897 reply_id: 111745[/import]

Hi!

Is vertical align of the text in a native.newTextField still not possible? Text input seems allways to be aligned to the top instead of the center of the field. Looks clumsy. [import]uid: 148841 topic_id: 12897 reply_id: 140628[/import]

Hi!

Is vertical align of the text in a native.newTextField still not possible? Text input seems allways to be aligned to the top instead of the center of the field. Looks clumsy. [import]uid: 148841 topic_id: 12897 reply_id: 140628[/import]