Multi-line text input

@erpy
I don’t think you’re talking about input text are you?

@shedder
I will take any solution. I don’t need it to look native and I could live without copy/paste. My whole app concept hinges on the user being able to type in a question that would involve multiple lines of text. I’m willing to try anything! Did you have something that worked? [import]uid: 22392 topic_id: 12097 reply_id: 44128[/import]

@noahm26
I don’t have an example to give you because it was just an experiment and gave up the idea… It’s not just that it’s missing the copy/paste but also you can’t move the cursor on the text, and more importantly, is a mess with the iOS text autocompletion.
What I was doing was getting the text input from a hidden native single line textfield, then updating a multi-line output text from the textfield event listener.

It’s not documented, but the input textfield listener, besides the “began”, “submitted” and “ended” phases, has also a “editing” phase, with some additional values like:
“numDeleted” (if you deleted a char it gives the position)
“startPosition”
“text” (the text of the textfield
“oldText” (text before editing)
“newCharacters” the last character you have pressed on the keyboard

So, on phase “began” I cleared the output textbox, then I updated it from the listener with the “editing” phase, using newCharacters, text and oldText to mirror the contents.

But as I told you, there are tons of problems, I gave up because it was just too complex to manage correctly… probably is easier/faster to create your custom keyboard and build a multi-line text input, but still… takes a lot of time and probably it’s going to look weird…

IMO, the lack of a multi-line input text is probably the worst fault of Corona…

Update: Another solution, you could use a webview and html elements (there are some examples on how to communicate between Corona and webview contents), but again, the webview has also many problems (gray loading screen and stuff like that…) [import]uid: 9158 topic_id: 12097 reply_id: 44135[/import]

I don’t know if it can help you, but I just found something quite similar to what I was doing (however, instead of using an enterframe I was using the editing phase)

http://developer.anscamobile.com/forum/2011/03/15/multiline-input-text-workaround

Same big problems… [import]uid: 9158 topic_id: 12097 reply_id: 44137[/import]

Well I have to agree that this is my biggest problem with Corona. In my search, I have seen people begging for this feature for months now! Can it really be that hard to implement? [import]uid: 22392 topic_id: 12097 reply_id: 44139[/import]

Yeah, I always thought it couldn’t be so hard to add a multi-line input textbox… but evidently there’s some problem we don’t know, otherwise it would have been already implemented…

However I’m not really sure where is the problem…

The native textbox we already can use in Corona (newTextBox) should be a UITextView, a component that already support input/edit… No idea why in Corona it’s not editable…

http://developer.apple.com/library/ios/documentation/uikit/reference/UITextView_Class/Reference/UITextView.html#//apple_ref/occ/instp/UITextView/editable [import]uid: 9158 topic_id: 12097 reply_id: 44144[/import]

@noahm26

Oops! You’re right. I missed the “input” part in the OP. :slight_smile:
Definitely something to have then! [import]uid: 5750 topic_id: 12097 reply_id: 44150[/import]

I need multiline text boxes as well. [import]uid: 60707 topic_id: 12097 reply_id: 44353[/import]

i have 2 projekts where i realy need multiline text input !!!
please please [import]uid: 73028 topic_id: 12097 reply_id: 48353[/import]

ditto the sentiments here… [import]uid: 34747 topic_id: 12097 reply_id: 48405[/import]

Same here [import]uid: 31262 topic_id: 12097 reply_id: 48414[/import]

I need multiline text boxes as well [import]uid: 29364 topic_id: 12097 reply_id: 49458[/import]

Status on this one? Will be a showstopper for me, too. Read that as: reason to port from Corona to… [import]uid: 5822 topic_id: 12097 reply_id: 51497[/import]

Well… it’s about 7 months I’ve been asking for a multi-line text input…
I guess it’s just not going to happen :frowning:

Here you can find some ideas, but honestly, IMO, not good enough to use it in a commercial app:
http://developer.anscamobile.com/forum/2011/02/24/textbox-input

The only solution (if you want a native input textbox) is to use a webpopup view with a html textbox and return the text to Corona… kinda terrible though :frowning: [import]uid: 9158 topic_id: 12097 reply_id: 51500[/import]

Here the same ! I have everything ready for 1 project and cannot release. Need to make multiline text input. If I knew that there wasen’t multiline text input, I wouldn’t have spent the licence money for Andruid and Iphone.
This sucks!!! [import]uid: 73028 topic_id: 12097 reply_id: 51505[/import]

I just can confirm… corona also comes a showstopper for me, just because of that. :frowning:

I really don’t understand why also carlos does not give any answers here for that.

If i look on the roadmap what they all like to do…i would prefer some BASICS would be
implemented first… like this multiline input and for android the android widgets. BASICS !!!

i really love developing with corona, but stuff like that should be PRIO 1… before i
think about (roadmap: Improved line drawing API, Bezier Manupulation … )

+1 for a full working MultiLine TextINput !!

[import]uid: 4795 topic_id: 12097 reply_id: 54317[/import]

I can confirm you that in the latest daily builds the textbox element is finally editable, so this problem has been solved! :slight_smile: [import]uid: 9158 topic_id: 12097 reply_id: 54320[/import]

can you give me a demo? [import]uid: 29364 topic_id: 12097 reply_id: 55675[/import]

local pretext = “hello world”
inputField = native.newTextBox( 50, 150, 680, 500, handlerFunction )
inputField.inputType = “default”
inputField.text = pretext
inputField.isEditable = true
inputField.size = 18
localGroup:insert(inputField)

– and should u like that the keyboard appears automatically add
native.setKeyboardFocus(inputField)

enjoy
chris
[import]uid: 4795 topic_id: 12097 reply_id: 55676[/import]

I have a try, but the codes don’t support on ios device,is it? it still read only [import]uid: 29364 topic_id: 12097 reply_id: 55801[/import]

Hello all, if you need multi-line text input, please use native text boxes rather than textFields:

http://developer.anscamobile.com/reference/index/nativenewtextbox

The only difference is that you need to make sure the isEditable property is set to true. [import]uid: 52430 topic_id: 12097 reply_id: 79278[/import]