【发布时间】:2011-10-07 03:27:27
【问题描述】:
我看过各种关于 iOS 4.2 的 UITableView 背景颜色的帖子,但我似乎无法更改背景颜色。
UIView *bgView = [[[UIView alloc] init] autorelease];
bgView.backgroundColor = [UIColor blackColor];
bgView.opaque = YES;
self.myTableView.backgroundView = bgView;
我已将此代码放在 viewDidLoad 中,但它不会改变颜色。我的 UITableView 是带有 UITableViewDelegate 和 UITableViewDataSource 的 UIViewController 内的 IBOutlet,所以我在 viewDidLoad 处考虑 UITableView 已经渲染,我无法更改其背景颜色。
EDIT * - UITableView 被分组
【问题讨论】:
标签: ipad uitableview