Wish [XUI Views] B4XFloatTextField Read-only mode and allow to select and copy text value

rraswisak

Active Member
Licensed User
You can make the InputType none
When using InputType=None it act like the disabled text field, no cursor focus made and can't select text value either.
B4X:
    Dim txtName As B4XFloatTextField
    Dim et As EditText = txtName.TextField
    et.InputType = et.INPUT_TYPE_NONE
Same behaviour with regular EditText

B4XFloatTextField1.mBase.Enabled = False
I just wish to be able focus and copy text value in the field but not allow to edit the value and no keyboard may appear

1596443103436.png


*I update thread title so it more clear what i wish for.
 
Last edited:

TILogistic

Expert
Licensed User
Longtime User
Test Basic:

B4XFloatTextField1.lblClear.Enabled = False
B4XFloatTextField1.lblV.Enabled = False
Dim et As TextField = B4XFloatTextField1.TextField
et.Editable = False

NOTE:
remember it is a custom view with multiple elements
 
Last edited:

Mahares

Expert
Licensed User
Longtime User
but not allow to edit the value and no keyboard may appear
If no keyboard is to appear, that means the B4XFloatTextField is already filled. Why don't you just copy the text to a string and fly with it. Why do you need to copy the text. But, if you do, you can always use the Clipboard lib to get the text and copy it somewhere else.
B4X:
B4XFloatTextField1.Text="Oparra"
    B4XFloatTextField1.TextField.Enabled=False
    Dim str As String = B4XFloatTextField1.Text
    Log(str)
 

Xfood

Expert
Licensed User
When using InputType=None it act like the disabled text field, no cursor focus made and can't select text value either.
B4X:
    Dim txtName As B4XFloatTextField
    Dim et As EditText = txtName.TextField
    et.InputType = et.INPUT_TYPE_NONE
Same behaviour with regular EditText


I just wish to be able focus and copy text value in the field but not allow to edit the value and no keyboard may appear

View attachment 98015

*I update thread title so it more clear what i wish for.
Hello @rraswisak sorry, were you able to find a solution to this problem?
I would also need to have a read-only edittex, with the possibility of selecting part of the text, and copying it
 
Top