【发布时间】:2012-08-13 12:32:02
【问题描述】:
在moreNavigationController中设置UITableView的backgroundView后像这样...
UITableView *moreTableView = (UITableView *)tabBarController.moreNavigationController.topViewController.view;
[moreTableView setBackgroundView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg.png"]]];
...UITableView 的单元格将其backgroundColor 从白色更改为透明(透明)。我尝试使用以下代码行将其设置回白色...
for (UITableViewCell *cell in [moreTableView visibleCells]) {
[cell setBackgroundColor:[UIColor whiteColor]];
}
...但不幸的是,这不起作用,所以我想唯一的解决方案是在 -willDisplayCell: 方法中设置该背景颜色。谁能告诉我如何访问该方法?任何帮助将不胜感激。
【问题讨论】:
标签: iphone ios cocoa-touch ios5 uikit