0
\$\begingroup\$

enter image description here

In my app's registration screen, the textfield is not wrapping text as I expected. Notice in the above image, the email field is not containing the text. I have set the size of the textfield using setSize() method but I couldn't find any way to wrap text. Is there any solution to this?

I'm using LibGDX v1.9.0.

EDIT: I don't have problem with overflowing but I think it should be hidden beyond the textfield borders.

UPDATE: It was indeed carelessness from my part. I actually included a padding to the textfield position which I didn't correct when defining its size. Issue got solved now. I don't know whether I should keep the question or delete it.

\$\endgroup\$
1
\$\begingroup\$

The libGDX TextField is, according tho the API specification, a "A single-line text input field.".

That's why it's not wrapping the text.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Okay but still the text should be behind the borders of the textfield, you know? How can I make it that possible? \$\endgroup\$ – WeirdElfB0y Apr 18 '16 at 10:00
  • \$\begingroup\$ @BlackPanda Can you show more of your layout code? TextField will scroll the text inside its bounds if more text that can be showed is inputted so it looks like it's your layout that's the problem here. \$\endgroup\$ – bornander Apr 19 '16 at 14:25
  • \$\begingroup\$ Here it is: pastebin.com/iVJVi8WS The text is indeed scrolling, but it is visible outside the bounds. \$\endgroup\$ – WeirdElfB0y Apr 20 '16 at 6:06
  • 1
    \$\begingroup\$ Sorry for wasting your time, but it was indeed carelessness from my part. I actually included a padding to the textfield position which I didn't correct when defining its size. Issue got solved now. \$\endgroup\$ – WeirdElfB0y Apr 21 '16 at 7:40
  • 1
    \$\begingroup\$ @BlackPanda Not a problem, glad you found the solution. \$\endgroup\$ – bornander Apr 21 '16 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.