Hey guy's First of all thanks for reading this. I'm having trouble to find a way to change my EditText when I loose focus to it. I would like it to be greyed out when this happens, but I don't want it to be disabled because the user can touch it and edit the text later.
Anyone?
Greetings!
It's possible to preserve both the style of the view and the scrolling behaviour. 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.
You can set different colors to the text based on an OnFocusChangeListener
Another option is to set a style in xml. See this question for details: Android: change style when focused
To change the opacity, use setAlpha. In this answer I show it how to do it in an animation: Two questions about custom app ui's and AlphaAnimation
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