0
我有以下方法,它适用于我想要的。更改整个应用程序的UITableViewCell的背景视图
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
UIView *colorView = [[UIView alloc] init];
colorView.backgroundColor = [UIColor darkGrayColor];
[cell setSelectedBackgroundView:colorView];
cell.selectedBackgroundView = colorView;
}
现在,有没有办法模仿这种行为对整个应用程序,而不是增加这种方法每tableViewController
?
你可以只用'[的UITableViewCell外观]'。 – 2014-09-01 23:12:06
谢谢,这工作。哪里是添加此代码的最佳地点? 'AppDelegate'? 'rootViewController'? – Jorge 2014-09-01 23:22:42
只要你在显示任何表格视图之前执行它,任何一个都可以。就我个人而言,如果可能的话,我喜欢避免将过多的东西放入应用程序代理中。 – keeshux 2014-09-01 23:25:46