【问题标题】:UITableView background issue when upgrade iOS7升级iOS7时UITableView后台问题
【发布时间】:2013-11-28 10:13:10
【问题描述】:

我使用 UITableView 没有设置任何背景颜色,但是当我从 iOS6 升级到 iOS7 时,我发现 UITableView 行为不端。问题在于它的背景颜色。

【问题讨论】:

  • 究竟是什么不当行为?

标签: ios objective-c uitableview uicolor


【解决方案1】:

你需要设置tableview的背景颜色如下

tableView.backgroundView = nil; 
tableView.backgroundColor = [UIColor redColor];

【讨论】:

    【解决方案2】:

    在 iOS7 UITableView 默认背景颜色是 clearColor。所以你可以通过添加 viewDidLoad 方法来改变它:

    self.tableView.backgroundColor = [UIColor yellowColor];
    

    这是很好的参考

    UITableViewCell show white background and cannot be modified on iOS7

    【讨论】:

      【解决方案3】:

      尝试在表格视图可见后设置其背景颜色。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-11-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-20
        • 2021-06-11
        相关资源
        最近更新 更多