Android Question How to set EditText Background Colors.Transparent

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
is it possible to set background to one color on focus and to another color when lost focus ?
this is a way to let the user know where he is on the data entry flow
it can also be used to indicate for mandatory field (for example light red background) or optional (light yellow)
when focus on the field to paint the background and when lost focus to return it to whatever it was...
is this possible ?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Place the edit text in a Panel, set the panel to transparent and play with canvas and drawable to change the border color/width...
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
thanks,
seems not very friendly as it will require each edit text into a panel and that's quite a hustle
i am more into changing the background similar to vb.net for example
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
You could create it as a custom view, and expose the necessary properties, it would then act as a single view
 
Upvote 0
Top