From what I understand from the documentation, you can create a native text field with a x,y,width,height, and listener, but what about with pre-entered text? If not, can we expect to have this added in the near future?
As it currently stands, I create the text field when a touch even occurs on a Corona Display Object. This creates a new Text field in the desired location, and once the user is finished with their input, it removes the text field and creates a new Corona text object in its place. I’d rather not have to keep the text fields present constantly, due to their many issues compared to a Corona object.
Examples of use-
If a user leaves focus on a text field and goes back to it, the text field can be recreated with previous data
A text field with a default text setting
User goes back to a previous screen with data inputted. Text fields are recreated with previous info.
I’m trying to use the textField.placeholder property. Does anyone know how to change the text color for the placeholder text? I’d like to make it a lighter shade of grey?
Alternatively, does anyone have sample code showing how to use textField.text to accomplish the placeholder functionality? I can set the .text property to the placeholder text, i.e. “Name”, but can’t get it to disappear once the user touches the text field. Thanks!
@natelipscomb, try changing .text value to blank (i.e., " ") at “began” phase. If you want to remove space (i.e., " "), play with event.startPosition during “editing” phase.
I’m trying to use the textField.placeholder property. Does anyone know how to change the text color for the placeholder text? I’d like to make it a lighter shade of grey?
Alternatively, does anyone have sample code showing how to use textField.text to accomplish the placeholder functionality? I can set the .text property to the placeholder text, i.e. “Name”, but can’t get it to disappear once the user touches the text field. Thanks!
@natelipscomb, try changing .text value to blank (i.e., " ") at “began” phase. If you want to remove space (i.e., " "), play with event.startPosition during “editing” phase.
I’m using a native.textfield object and would like the focus to remain on the object such that the border does not go away and the user understands that they need to enter a value. I’ve played with the placeholder & text properties but this essentially just predefines a default value and unless the user clicks on that their isn’t any indication that the area is expecting input. If native.textfield isn’t the best object to use for this can someone please let me know a better option, etc?
I’m using a native.textfield object and would like the focus to remain on the object such that the border does not go away and the user understands that they need to enter a value. I’ve played with the placeholder & text properties but this essentially just predefines a default value and unless the user clicks on that their isn’t any indication that the area is expecting input. If native.textfield isn’t the best object to use for this can someone please let me know a better option, etc?