Royi Namir
Royi Namir

Reputation: 148634

How can I change the bottom border color for TextField when focus?

I have a simple TextField :

enter image description here

How can I change the blue color (programmatically) to another color , when textfield is in focused ?

I've already accomplished partial solution :

  var v=this.page.getViewById< TextField>("a");
  var drawable = v.android.getBackground(); 
  drawable.setColorFilter(new Color("#b21755").android, android.graphics.PorterDuff.Mode.SRC_ATOP); 

But When I navigate to another control , the red color remains :

When It's in focus :

enter image description here

when It's out of focus : (red remains — I don't want that , I want the default color )

enter image description here

How can I make the color to back to its default color when moving out of focus ?

Upvotes: 1

Views: 463

Answers (1)

dashman
dashman

Reputation: 3028

on lose focus, call clearColorFilter() .

Upvotes: 2

Related Questions