Android Question [SOLVED] B4XPages / EditText disable edit with scroll ability

Tecuma

Member
Licensed User
Hello Community,

in B4J (TextArea) and B4i (TextView) I am able to disable edit and scroll a longer text. When I try the same on B4A with EditText I can disable it but then I can not scroll or I can scroll but then I can also edit.

Is it possible with EditText to scroll without being able to edit the text?

Best regards

--Christian
 

William Lancee

Well-Known Member
Licensed User
Longtime User
I Googled. If you know how to use inline java then try the code below.

I'll investigate, but I don't know how 'yet':)

B4X:
private void disableEditText(EditText editText) {
    editText.setFocusable(false);
    editText.setEnabled(false);
    editText.setCursorVisible(false);
    editText.setKeyListener(null);
    editText.setBackgroundColor(Color.TRANSPARENT);
 }
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Simple! In designer set multiline (single line off) and InputType to "NONE". Works like magic.

or in code

B4X:
    EditText1.InputType = EditText1.INPUT_TYPE_NONE
    EditText1.SingleLine = False
 
Last edited:
Upvote 0
Top