Lukas Lukas - 5 months ago 234
iOS Question

change disclosure indicator color on cell selection

I've read some posts on this, but still can't get the answer to my question.

I have a disclosure indicator. enter image description here

I add it like this:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;


Everything works fine and is good, the only thing i want to change is when i press down the cell, disclosure indicator changes color to white. enter image description here I don't want that. So my question is how to make the disclosure indicator color fixed, and not changing?

Thanks in advance!

Answer

You need to use a custom accessory view for this. Syntax:

cell.accessoryView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"accessory.png"]] autorelease];

Here you are assigning an image view with an image accessory.png

to your cell's accessory view.

Comments