我正在设置一个 View 作为 uitableview 的背景。 View 只有 colorWithPatternImage。
它在 iOS6 中工作正常,但在 iOS7 中,它没有任何效果,TableView 背景在 iOS7 中仍然只是白色。我正在使用 Three20 库。
我的代码是
UIImage *imgBackGround = [UIImage imageNamed: @"my_background.png"];
self.tableView.backgroundColor = [UIColor clearColor];
UIView *backView = [[UIView alloc] initWithFrame:self.view.frame];
[backView setBackgroundColor:[UIColor colorWithPatternImage:imgBackGround]];
self.tableView.backgroundView = backView;
[backView release];
self.view.backgroundColor=[UIColor colorWithPatternImage:imgBackGround];
iOS7 会出现什么问题?
请帮助,提前致谢。
最佳答案
在 iOS 7 中,tableview 单元格自动具有白色背景色。您需要清除单元格的颜色和背景。
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView = [UIView new];
在 cellForRowAtIndexPath 中使用这肯定会解决它。
关于uitableview - tableView backgroundView 在 iOS7 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19268384/