【发布时间】:2011-02-10 21:27:24
【问题描述】:
当我为我的UITableView 设置backgroundColor 时,它在 iPhone(设备和模拟器)上运行良好,但在 iPad 模拟器上却不行。相反,对于我设置的任何颜色,包括groupTableViewBackgroundColor,我都会得到浅灰色背景。
重现步骤:
- 创建一个新的基于导航的项目。
- 打开 RootViewController.xib 并将表格视图样式设置为“分组”。
- 将此响应程序添加到 RootViewController:
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor blackColor]; } - 选择 Simulator SDK 3.2,构建并运行。
- 您将获得黑色背景(设备和模拟器)。
- 在项目树中选择您的目标。
- 单击项目:升级当前 iPad 目标。
- 构建并运行。
- 您将获得浅灰色背景。
- 将表格视图样式恢复为纯色,您将获得黑色背景。
感谢您的帮助!
【问题讨论】:
-
啊,现在 iPhone 和 iPad 在 iOS6 中再次对齐了 :-)
-
非常感谢使用很少使用的术语“复制步骤”! :-p
标签: ipad uitableview iphone-sdk-3.2 background-color