我正在尝试将嵌入式 UITableView 上的灰色渐变背景更改为我在 Storyboard 的父 View 上设置的颜色。
我一直在环顾四周,发现以下线程:
我在连接两个 View 的父 Controller 中有一个 IBOutlet。
我的实现如下所示:
- (void)viewDidLoad {
[super viewDidLoad];
[activeShipmentsTable setBackgroundView:nil];
[activeShipmentsTable setBackgroundView:[[[UIView alloc] init] autorelease]];
[activeShipmentsTable setBackgroundColor:UIColor.clearColor];
}
我究竟做错了什么?
谢谢。
最佳答案
尝试在表格的背景 View 上设置背景颜色,而不是表格本身。
UIView *view = [[[UIView alloc] init] autorelease];
view.backgroundColor = [UIColor redColor];
self.tableView.backgroundView = view;
关于ios - 更改嵌入在 iOS 5 上的 UIViewController 中的 UITableView 的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8962726/