Using a textbox within and group that can be touch'ed

Hi

In a business app on IOS I have an interface for editing a post-like object, with what could be a long text and also an image that I show below that text. 

I’m using a native TextBox for editing the text, and I want to include that and the image in a group that I want to scroll up and down (using touch events) given that a big portion of the screen is used up by the keyboard. 

I realise that the TextBox is above the OpenGL display layer, but it feels like it is intercepting not only the tap events but also the touch events, which means that the group which “contains” the TextBox is not receiving the touch events (it works fine when touching the image below the TextBox)

Any clues how I can solve or work around this ?

 DH

That is correct.  You cannot drag a native text field or text box.  They capture all touches.

You need to have a proxy in place when not editing.

I can’t show you the code because, while straight-forward it is lengthy.

In short, I represent text fields not currently being edited with a background rect/image and a text object showing whatever the text of the text field has associated with it.

Then, if the user taps the ‘background’ rect/image, I create a native text field at the correct position with the text from the text object. I then hide the rect/image and the text object.  I also attach a text listener that does the work of keeping the text object up to date.  Finally, I set keyboard focus to the new field.

When I exit the field, I destroy it and reshow the rect/image and text object (newly updated).

In the case of a drag, I do not create the text field.

Again, long, but if you want a dragable text field, that is the only way I know.  It also avoids the issue of trying to have a scroller move a text field beyond the bounds of the scroller space.  In that scenario, the native text field isn’t hidden as you would expect because as you mentioned it is really on top of everything.

Note: This means, that at any one time  you will only have one native text field in your scroller, so tabbing/advancing to the next one won’t work and you’ll have to figure out an alternative way to make that functionality.

This video shows one part of a tool I made last year for editing and generating story apps.  All of the editor components use the same concept of click to wake as I describe above:

https://www.youtube.com/watch?v=UEckCM-0gTg&feature=youtu.be

>That is correct.  You cannot drag a native text field or text box.  They capture all touches. You need to have a proxy in place when not editing.

 

Yeah i’ve used proxies, but I was hoping to drag the TextBox while editing is active (kind of like when editing a facebook post) :confused:

Sorry.  I never was able to figure this out.  i.e. Dragging directly on the text box.

If you figure it out, please post back the secret.  That would be huge.

That is correct.  You cannot drag a native text field or text box.  They capture all touches.

You need to have a proxy in place when not editing.

I can’t show you the code because, while straight-forward it is lengthy.

In short, I represent text fields not currently being edited with a background rect/image and a text object showing whatever the text of the text field has associated with it.

Then, if the user taps the ‘background’ rect/image, I create a native text field at the correct position with the text from the text object. I then hide the rect/image and the text object.  I also attach a text listener that does the work of keeping the text object up to date.  Finally, I set keyboard focus to the new field.

When I exit the field, I destroy it and reshow the rect/image and text object (newly updated).

In the case of a drag, I do not create the text field.

Again, long, but if you want a dragable text field, that is the only way I know.  It also avoids the issue of trying to have a scroller move a text field beyond the bounds of the scroller space.  In that scenario, the native text field isn’t hidden as you would expect because as you mentioned it is really on top of everything.

Note: This means, that at any one time  you will only have one native text field in your scroller, so tabbing/advancing to the next one won’t work and you’ll have to figure out an alternative way to make that functionality.

This video shows one part of a tool I made last year for editing and generating story apps.  All of the editor components use the same concept of click to wake as I describe above:

https://www.youtube.com/watch?v=UEckCM-0gTg&feature=youtu.be

>That is correct.  You cannot drag a native text field or text box.  They capture all touches. You need to have a proxy in place when not editing.

 

Yeah i’ve used proxies, but I was hoping to drag the TextBox while editing is active (kind of like when editing a facebook post) :confused:

Sorry.  I never was able to figure this out.  i.e. Dragging directly on the text box.

If you figure it out, please post back the secret.  That would be huge.