Dear Corona community,
In my scene:create function, I set up a newTextfield:
usernameInput = native.newTextField(display.contentCenterX, galleryButton.y - galleryButton.contentHeight - 10, display.contentWidth - 60, 50) usernameInput.font = native.newFont(native.systemFontBold) usernameInput.hasBackground = false usernameInput:setTextColor(0.35) usernameInput.align="center" usernameInput.anchorY = 1 usernameInput.text = "Test"
Problem is: I see “Test” only when I click on the textfield. It sort of swipes in from the right side. I want it to be there from the beginning on though. It works fine on simulator, but not an Honor 8 or Galaxy S5 mini.
Any ideas?
// edit: Wow, narrowed it down to the line
usernameInput.align=“center”
If I leave it out, the username shows right away when the scene appears (positioned on the left side, as expected). But when I insert this line, the username only appears when I click on the textfield (positioned centered).
To me this does not make sense at all. Did I miss something? Why would aligning input text have such an impact on when the text appears on screen?