Native mobile field which allows highlighting and copying but not editing
Posted: Sun Mar 17, 2024 8:04 pm
I am trying to create a native mobile field which allows the user to highlight text and then copy it, but not edit (i.e. change) the text. This is done in a Livecode field by enabled both "lockText" and "autoHilite". But I cannot find any sort of equivalent for a Native mobile multiline control.
I have text in a Livecode field which the user may wish to copy. Unfortunately Livecode fields cannot copy to the mobile clipboard. So I place the text from the Livecode field into a native mobile field, and now the user can highlight and copy. But (at least on Android; have not tested on iOS) they can also edit the text, which I would prefer not be possible. They should not be able to change the text, just highlight a section and copy it.
I tried setting "editable" to false:
That does lock the text so it cannot be edited. But unfortunately it does not allow the user to highlight and copy text, merely read it.
This must be possible since many mobile apps do just this. I can highlight text in my web browser and copy it but not edit it. Indeed, the mobile keyboard does not ever appear when I highlight text in the web browser. It always appears when I create a native mobile field and click to enter it.
Anyone know of a way to accomplish this? Or perhaps some other clever way to accomplish my ultimate goal of allowing mobile users to highlight and copy a section of text from a Livecode field.
TIA.
Jeff
I have text in a Livecode field which the user may wish to copy. Unfortunately Livecode fields cannot copy to the mobile clipboard. So I place the text from the Livecode field into a native mobile field, and now the user can highlight and copy. But (at least on Android; have not tested on iOS) they can also edit the text, which I would prefer not be possible. They should not be able to change the text, just highlight a section and copy it.
I tried setting "editable" to false:
Code: Select all
mobileControlset "myNativeField", "editable", false
This must be possible since many mobile apps do just this. I can highlight text in my web browser and copy it but not edit it. Indeed, the mobile keyboard does not ever appear when I highlight text in the web browser. It always appears when I create a native mobile field and click to enter it.
Anyone know of a way to accomplish this? Or perhaps some other clever way to accomplish my ultimate goal of allowing mobile users to highlight and copy a section of text from a Livecode field.
TIA.
Jeff