1
\$\begingroup\$

I'm using Unity 5.0.1f1, and my UI Input Fields are not working as they are supposed to.

I have an Input Field that is placed in a Panel and inside a Canvas. It has a Text component in which I can set text that the Input Field will display. When I change value of this Text component, the changes are not reflected on the Input Field, it seems to be reset to the value of Input Field (Script) \ Text of the Input Field.

If I enter Play mode, I can input text normally but when I build and run on my Android phone, I cannot input anything.

Has anyone encountered this problem? How can I solve this?

text field malfunctioned

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

The children of the InputField GameObject are modified as needs be by the scripts that make the InputField work (you'll notice a input caret child appears at runtime too and as you say the text attribute of the child is overwritten).

If you need to set a default value for the text there is a field in the inspector of the InputField Component on the parent InputField GameObject; underneath the "navigation" attributes, there is a reference to the "Text Component" of the child and a field which says "Text", add your text here.

I'm not an android developer so I've no idea how to fix the second part of the problem.

\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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