简体   繁体   English

升级iOS7时UITableView后台问题

[英]UITableView background issue when upgrade iOS7

I am using UITableView without setting any background color but when I upgrade from iOS6 to iOS7 I found that UITableView misbehaves. 我使用UITableView未设置任何背景色,但是当我从iOS6升级到iOS7时,我发现UITableView行为异常。 The problem is its background color. 问题是它的背景色。

You need to set the tableview background color as below 您需要如下设置tableview背景颜色

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

In iOS7 UITableView default background color is clearColor. 在iOS7 UITableView中,默认背景色为clearColor。 So you can change it as following way by adding in viewDidLoad method : 因此,您可以通过添加viewDidLoad方法,按照以下方式进行更改:

self.tableView.backgroundColor = [UIColor yellowColor];

Here is the good reference 这是很好的参考

UITableViewCell show white background and cannot be modified on iOS7 UITableViewCell显示白色背景,无法在iOS7上修改

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM