Can anyone tell me how to make an EditText
not editable via XML? I tried setting android:editable
to false
, but
Make EditText non editable in Android To use this just set android:inputType="none" and it will become non editable.
Modify the default content of res/layout/activity_main. xml file to include Android UI control. Run the application to launch Android emulator and verify the result of the changes done in the application. Following is the content of the modified main activity file src/com.
Add this to your EditText xml file:
<EditText ... android:clickable="false" android:cursorVisible="false" android:focusable="false" android:focusableInTouchMode="false"> </EditText>
It will do the same effect as android:editable="false"
. Worked for me, hope it'll work for you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With