About 9,280,000 results
Open links in new tab
  1. Disabling of EditText in Android - Stack Overflow

    Jan 23, 2020 · To disable an EditText while keeping this properties, just use UI.setReadOnly(myEditText, true) from this library. If you want to replicate this behaviour without the library, check out the source code for this small method. I believe the correct would be to set android:editable="false".

  2. TextInputLayout | API reference - Android Developers

    If the EditText child is not a TextInputEditText, make sure to set the EditText's android:background to null when using an outlined or filled text field. This allows TextInputLayout to set the EditText 's background to an outlined or filled box, respectively.

  3. Android EditText Disable Edit and Focus (read only TextView …

    Mar 31, 2019 · If you disable EditText using setEnabled(false), the style/color will change to light gray. To disable EditText (no focus and edit) wihout disabling it. editText.isFocusable = true editText.isFocusableInTouchMode = true editText.inputType = TYPE_NULL

  4. Hide the Soft Keyboard and Remove Focus from EditText in Android

    May 31, 2023 · You might be wondering how to automatically hide the keyboard and remove focus from an EditText (or its subclass) when a user clicks elsewhere in your app. In this post, we'll go through a simple solution for this common situation. Before diving into the solution, let's introduce dispatchTouchEvent ().

  5. Android TextInputLayout Example - DigitalOcean

    Aug 3, 2022 · Floating Hints are enabled by default in a TextInputLayout. To disable it we need to add the following attribute inside the tag : app:hintEnabled="false". The below xml code is from the activity_main.xml layout and has three EditText fields. xmlns:app="https://schemas.android.com/apk/res-auto" xmlns:tools="https://schemas.android.com/tools"

  6. How to disable EditText in Android - Stack Overflow

    May 4, 2011 · you can use EditText.setFocusable(false) to disable editing EditText.setFocusableInTouchMode(true) to enable editing;

  7. android - EditText: how to enable/disable input? - Stack Overflow

    So in order to suppress any editing you should do following: new InputFilter() public CharSequence filter(CharSequence src, int start, int end, Spanned dst, int dstart, int dend) return src.length() < 1 ? dst.subSequence(dstart, dend) : ""; }); That will guarantee that EditText content won't be changed. Thanks for this suggestion.

  8. Making textinputlayout uneditable and setting click event on it

    Sep 30, 2017 · Set TextInputLayout android:clickable="true". Set TextInputEditText android:clickable="true" and android:focusable="false". Set View.OnClickListener on both TextInputLayout and TextInputEditText.

  9. android - How To Make TextInputEditText Read-only? - Stack Overflow

    Apr 11, 2019 · Try to add Edittext.setEnabled(false); or android:editable="false" to your view.

  10. Android - can't hide `TextInputLayout ... - Stack Overflow

    Sep 19, 2019 · Try setting the background to null for TextInputLayout. You can use: <com.google.android.material.textfield.TextInputLayout. app:boxStrokeWidthFocused="0dp" app:boxStrokeWidth="0dp"> It goes away if you set the background colour to transparent: where:

  11. Some results have been removed
Refresh