Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Need help with table view background (Closed)

I'm building an app with a tabbed view and in this app I use a table view for the first page and I changed the background of the table but when I create a new list item in the table the background and the font color doesn't change to what I set it to.

here is a picture of the problem: http://snag.gy/RcHYx.jpg

Thank you

1 Answer

Try to put in your method tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

[cell setBackgroundColor:[UIColor clearColor]];

i'm currently not using a method to set the background color i'm just using interface builder.

okay never mind I added to my cell creation method

    cell.backgroundColor = UIColor.clearColor()

and it worked. The background color of the cell is the same color as the table but then how to I change the font color?

sorry about this but thanks for your help in the end I came up with this.

let fontColor = UIColor.whiteColor()

    cell.detailTextLabel?.textColor = fontColor
    cell.textLabel?.textColor = fontColor

    cell.backgroundColor = UIColor.clearColor()