Stephane
Stephane

Reputation: 5078

How to set accessory view background to same background as content view in UItableViewCell?

I've successfully changed the background of table view cells to an image in my app but it does not extend to the background of the accessory view. Any idea to fix this ?

Thx for helping,

Stephane

Upvotes: 1

Views: 533

Answers (3)

ICL1901
ICL1901

Reputation: 7778

This is an old thread, that I found most helpful. What worked for me though, was to set the cell color in IB (the cell was a prototype):

enter image description here

Upvotes: 0

Tinku George
Tinku George

Reputation: 615

You can use the tableView:willDisplayCell:forRowAtIndexPath: delegate function of tableview. Give background color to the cell in that function. It will give the color to accessary view background also.

Upvotes: 1

SriPriya
SriPriya

Reputation: 1240

cell.textLabel.backgroundColor = [UIColor clearColor];
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg-Cell-Image.jpg"]];

try this way if you are using text label of the cell only to display content

Upvotes: 3

Related Questions