Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TableView cell on iPad refusing to accept clear color

I am using a github project called SWTableViewCell.h by Chris Wendel. On the iPhone, clear color works. However, on an iPad it refuses to make the tableview cell clear. Instead, it makes it white. I have been wracking my brain how to fix this but cannot. I have even tried to set the background based on a png, but it just will not work. What types of alternatives can I go about to solve this?

like image 803
user3642059 Avatar asked Jul 27 '14 01:07

user3642059


1 Answers

In the documentation for the project on GitHub, there is a method:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    // Set background color of cell here if you don't want default white
}

Change it to this:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    [cell setBackgroundColor:[UIColor clearColor]];
}
like image 50
rebello95 Avatar answered Nov 15 '22 04:11

rebello95