how to change text color on focus a cell?

407 Views Asked by At

I am working on a app and i have a main table view. By default in iPhone if a cell is on focus its font color changes to white. I used this code to set the font of my cell:

lblTemp.font = [UIFont boldSystemFontOfSize:18];
lblTemp.backgroundColor = [UIColor clearColor];

When a cell is on focus its text color doesn't change to white. it remains black. how can i change a text's color oc a cell to white when its on focus. Thanx

1

There are 1 best solutions below

0
On BEST ANSWER

Try to set highlightedTextColor property to your label:

lblTemp.highlightedTextColor = [UIColor whiteColor];