【问题标题】:tableView backgroundView is not working in iOS7表视图背景视图在 iOS7 中不起作用
【发布时间】:2013-10-09 09:40:44
【问题描述】:

我正在设置一个视图作为 uitableview 的背景。 View 只是有 colorWithPatternImage。

在 iOS6 中可以正常工作,但是在 iOS7 中没有任何效果,在 iOS7 中 TableView 背景仍然是白色的。我正在使用 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 会出现什么问题? 请帮忙,在此先感谢。

【问题讨论】:

  • 哇,你还在用 Three20 库吗?

标签: uitableview ios7


【解决方案1】:

在 iOS 7 中,tableview 的单元格自动具有白色背景色。您需要清除单元格的颜色和背景。

cell.backgroundColor = [UIColor clearColor];
cell.backgroundView =  [UIView new];

在 cellForRowAtIndexPath 中使用

这肯定会解决的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-21
    • 1970-01-01
    • 2014-02-06
    • 1970-01-01
    • 1970-01-01
    • 2018-06-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多