As with tapes in any free space, the text entered in the EditText , displayed in the TextView ? Initially display the EditText , enter the text, tap it (EditText) and then hide the TextView with the entered text in that place. Is the way right?

  • No, this is not a quality solution .. You can simply block editing in EditText using the setEnabled(false) method - pavlofff

1 answer 1

It is not necessary to substitute EditText with TextView , it is enough just to turn off / on the ability to edit using editText.setEnabled (false);

But if you want exactly your way, then put the TextView and EditText in the same layout with RelativeLayout and play with the visibility VISIBLE / GONE .

But the first option is better.

  • How to turn off when tapes in free space and turn on when tapes in the field? onFocusChanged () appropriate? - morethanfish
  • tell me about the "free space" to listen to editText.setEnabled (false), and to tap the "field" editText.setEnabled (true), obviously - Android Android
  • google.ru/… - Android Android
  • one
    @morethanfish I don’t understand what you want to get in the end. When you tap on free space, EditText will lose focus and there will be no input, but when tap on it, it will be again. Describe the logic that you need in the most detail in the question. - pavlofff
  • one
    I made the background transparent and the strip disappeared. - morethanfish