Down And Dirty Pictures: Miramax, Sundance, And The Rise Of Independent Film.epub 2021 ⏩halchar
Down And Dirty Pictures: Miramax, Sundance, And The Rise Of Independent Film.epub 2021 ⏩
Down And Dirty Pictures: Miramax, Sundance, And The Rise Of Independent Film.epub
supporting their bosses and careers .
Also like other indie film makers .
Changing background color of UITableViewCell row
I am using a custom UITableViewCell in my app. Inside this cell is a UIImageView and a UILabel. I want to set the background color of the rows of the table to white for the entire table, but I don’t know how to do that. I can change the color of individual cells, but I need to be able to change the background color of entire rows. I tried looking at the documentation for UITableView, but it seems very sparse.
In order to change the background color of the entire row, you would do the following:
Set the background color of your cell class. I presume in your case you have a custom cell with a UIImageView and a UILabel. Set the class of the cell in Interface Builder as the base class of the cell.
For your UITableViewCell subclass, in your viewDidLoad function, or where ever you configure your cell in viewDidLoad, you would do something like this:
// I’ll assume the UIImageView (the big background) and UILabel (the smaller text) are in the contentView of the cell
cell.contentView.backgroundColor = [UIColor whiteColor];
You don’t need to subclass UITableViewCell. Add the following function to your table view controller and change the context (which table to alter, and which row to change):
– (void)changeBackgroundColorInTable:(UITableView *)table View:(UITableView *)tableView rowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.backgroundColor = [UIColor redColor];
LEAVE A COMMENT