Transparent background for UITableViewCellAccessoryDetailDisclosureButton

Member
Posts: 38
Joined: 2008.09
Post: #1
I have a custom table cell, i set the accessory type to the disclosure button and set the background color, but the background still seems to be white.
Code:
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MonsterCellIdentifier] autorelease];
cell.contentView.backgroundColor = [UIColor colorWithRed:116.0/255.0 green:134.0/255.0 blue:56.0/255.0 alpha:1.0];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.accessoryView.backgroundColor = cell.contentView.backgroundColor;

Why doesnt the disclosure button take on the background color of the accessory?
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #2
The cell's background color gets set to white as it is being displayed - you can override this by implementing tableView:willDisplayCell:forRowAtIndexPath: in your delegate and changing the background color there.
Quote this message in a reply
Member
Posts: 38
Joined: 2008.09
Post: #3
That changed the background color of the cell, but the accessory view still wasnt affected. So I instead created my own accessory view, created my own button to get the desired effect.
Quote this message in a reply
Post Reply