UITableView backgroundColor在iPad上始终为灰色 [英] UITableView backgroundColor always gray on iPad
本文介绍了UITableView backgroundColor在iPad上始终为灰色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我为 UITableView
设置 backgroundColor
时,它在iPhone(设备和模拟器)上工作正常,但不是iPad模拟器。相反,我为我设置的任何颜色设置浅灰色背景,包括 groupTableViewBackgroundColor
。
When I set the backgroundColor
for my UITableView
it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a light gray background for any color I set including groupTableViewBackgroundColor
.
重现的步骤:
- 创建一个新的基于导航的项目。
- 打开RootViewController.xib并将表视图样式设置为 Grouped。
- 将此响应者添加到RootViewController:
- Create a new navigation-based project.
- Open RootViewController.xib and set the table view style to "Grouped".
- Add this responder to the RootViewController:
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor blackColor];
}
感谢您的帮助!
推荐答案
尝试其中一种。
[myTableView setBackgroundView:nil];
[myTableView setBackgroundView:[[[UIView alloc] init] autorelease]];
这篇关于UITableView backgroundColor在iPad上始终为灰色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文