Quick question...

Is there a way to insert a field for user input into a scrollview? 

No.  The native.newTextField()'s are non OpenGL objects and can’t interact with Corona display groups (which is what a ScrollView is)

Rob’s right about the native fields - if you stick a native field in a scrollView (or tableView) row, it won’t obey the regular sdk graphics rendering rules (in particular the scroll mask) and the field would just keep scrolling right outside the scrollview no doubt (on top of regular display objects).

However, you probably can put in your rows a rounded rectangle (standard display.newRect) with some dimmed standard text (display.newText) on top that reads something like “Enter text here” to simulate a native input field (called a “mock” input field below)…

It’s up to you to handle the user tap and determine if it’s in the rows mock input field. If it is on the rows mock input field, *then* fire up the real native input handler. You can safely draw the native field on screen at that point, since native fields always appear on top of regular corona objects. (getting the exact coord of the mock input area given the scrollview being in the mix could be an issue, never actually tried this…)

Working in your favor is that a lot of devs rarelt keep native input fields on the screen anyways (because as Rob says they “can’t interact with Corona display groups” , so there should be a fair amount of references to this kind of mock input area technique on the forums.

I’d imagine the tricks are a) determining whether the tap is for the input field, or something else in the row (there’s a bunch of ways to approach this no doubt)… and B) aligning the real native input cell exactly on top of the scrollView (or tableView) mock input field.

I’d guess a dozen or two people have done this with corona by now… Maybe someone can throw benjamin.lurker a snippet?

Edit: Given there’s a scrollview (tableView) involved… You’ll probably also have to disable the scrolling during the actual input (and other app functions as well of course)… Since with corona, text input is asynchronous – all the other things in your app keep working / receiving events…

No.  The native.newTextField()'s are non OpenGL objects and can’t interact with Corona display groups (which is what a ScrollView is)

Rob’s right about the native fields - if you stick a native field in a scrollView (or tableView) row, it won’t obey the regular sdk graphics rendering rules (in particular the scroll mask) and the field would just keep scrolling right outside the scrollview no doubt (on top of regular display objects).

However, you probably can put in your rows a rounded rectangle (standard display.newRect) with some dimmed standard text (display.newText) on top that reads something like “Enter text here” to simulate a native input field (called a “mock” input field below)…

It’s up to you to handle the user tap and determine if it’s in the rows mock input field. If it is on the rows mock input field, *then* fire up the real native input handler. You can safely draw the native field on screen at that point, since native fields always appear on top of regular corona objects. (getting the exact coord of the mock input area given the scrollview being in the mix could be an issue, never actually tried this…)

Working in your favor is that a lot of devs rarelt keep native input fields on the screen anyways (because as Rob says they “can’t interact with Corona display groups” , so there should be a fair amount of references to this kind of mock input area technique on the forums.

I’d imagine the tricks are a) determining whether the tap is for the input field, or something else in the row (there’s a bunch of ways to approach this no doubt)… and B) aligning the real native input cell exactly on top of the scrollView (or tableView) mock input field.

I’d guess a dozen or two people have done this with corona by now… Maybe someone can throw benjamin.lurker a snippet?

Edit: Given there’s a scrollview (tableView) involved… You’ll probably also have to disable the scrolling during the actual input (and other app functions as well of course)… Since with corona, text input is asynchronous – all the other things in your app keep working / receiving events…