首页 > 其他 > 详细

分组的UITableView的背景设置问题

时间:2014-01-21 23:22:23      阅读:502      评论:0      收藏:0      [点我收藏+]

在一个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的背景设置问题

原文:http://www.cnblogs.com/zyqf1234/p/3528927.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!