分组的UITableView的背景设置问题

作者: shaneZhang 分类: ios技术 发布时间: 2014-04-26 00:15

在一个UIViewController的viewDidLoad方法中增加一个UITableView,设置其backgroundColor为透明色。

UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style: UITableViewStyleGrouped];//
UITableViewStyleGrouped为分组样式
tableView.dataSource = self;tableView.delegate = self;
tableView.backgroundView = nil;
 tableView.backgroundColor = [UIColor clearColor];[self.view addSubview:tableView];

目前对于这个问题的解决方法是将Group类型的tableView的backgroundView设为一个新的空白View或简单的设置为nil.如下

tableView.backgroundView = [[UIView alloc]init];
tableView.backgroundColor = [UIColor clearColor];

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

 

本页面支持繁体中文友好显示:分组的UITableView的背景设置问题

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注