Text input ... not using newTextField

Has anyone done any custom text input methods?

I want to be able to have the user enter text, but I don’t want the native device text field look. I wanted to be able to control the size of the text, the font, the color, having a transparent background, and removing any sort of borders. From what I can see, newTextField does not allow that.

Is there a way to call up the keyboard another way and display what the user types? This would be the equivalent of a single line text field, so don’t need a whole lot of functionality. Just need to be able to allow the user to enter text using any of the device keyboards and customize that text as it is displayed on the screen.

Appreciate any pointers. [import]uid: 17827 topic_id: 21238 reply_id: 321238[/import]

Well if you want to put the effort in it, you could make your own keyboard, create your 26+ buttons and setup event handlers for each one that would let you add letters to a string. You would have to program in backspace functionality and such.

I also don’t know if Apple would approve it either, but…

you could do want you want. Of course in the simulator, you would have to use the mouse to touch the keyboard since there are no bindings to actual keystrokes.

[import]uid: 19626 topic_id: 21238 reply_id: 84122[/import]

Yeah, I didn’t want to go down the route of creating my own keyboard. :slight_smile:

Was just hoping that someone else out there has done more text stuff in Corona and might have advice or suggestions for that. [import]uid: 17827 topic_id: 21238 reply_id: 84129[/import]

Actually you can select align, font type, size and color of a newTextField. Also, if I remember correctly from some tests I made, there’s should be a .hasBackground parameter (undocumented) to make the background transparent (same as newTextBox).
Of course, it still has that “native ios” look, but you can customize a little… [import]uid: 9158 topic_id: 21238 reply_id: 84155[/import]

shedder,
Thanks for that information. Very helpful.

I was wondering if you could make the text field transparent. Though with the border, probably won’t have the same look I was hoping for.

I wish there was a way to easily preview the look in the simulator, so I could play around and see what I could do with the look of this.

Thanks again. [import]uid: 17827 topic_id: 21238 reply_id: 84163[/import]

In the for what it is worth category, you can create two objects - one text object on screen and one text input field that the keyboard is attached to and define it to be off screen (e.g., top value of display.contentHeight + 100 or something). They watch the off screen text field events and modify the on screen contents of the text object. The you have almost complete control over the on screen contents. [import]uid: 117477 topic_id: 21238 reply_id: 86713[/import]

There is one made by one of our users. I haven’t used it personally so can’t say. I presume its fully customizable though and uses no native elements.

http://developer.anscamobile.com/code/floating-keyboard [import]uid: 84637 topic_id: 21238 reply_id: 86725[/import]

Thanks, Danny.

I wonder what would happen if I tried to use that in the Android version of the app. :slight_smile: [import]uid: 17827 topic_id: 21238 reply_id: 88034[/import]

kwc_jr,
Thanks for the suggestion. I had thought of that, but what I couldn’t figure out was how to have the keyboard appear when the user clicks in the text object.

I see code for capturing the values in the text input field that I think would work. But don’t see any way to make the keyboard appear as if the user clicks in the text input field.

Edit:
Never mind, I will try native.setKeyboardFocus() and see if that works. After re-reading that documentation, I think that might work. [import]uid: 17827 topic_id: 21238 reply_id: 88028[/import]

.hasBackground actually seems to work on native.newTextField. It’s not documented but it works ( tried on 787 ). [import]uid: 134089 topic_id: 21238 reply_id: 105255[/import]

.hasBackground doesn’t work for me with native.newTextField. It does work with native.newTextBox. I’m currently on version 819. Is there a trick to getting it to work? [import]uid: 108272 topic_id: 21238 reply_id: 109531[/import]