[转]去除Grouped UITableView的边框与背景

来自:http://www.xiaojiayi.com/2012/12/03/%E5%8E%BB%E9%99%A4grouped-uitableview%E7%9A%84%E8%BE%B9%E6%A1%86%E4%B8%8E%E8%83%8C%E6%99%AF/

 

viewDidLoad中,

self.tableView.backgroundView = nil; //去除table背景

[self.tableView setSeparatorColor:[UIColor clearColor]]; //去除边框

cell创建过程中,

[cell setBackgroundColor:[UIColor clearColor]];  //去除背景

然后就可以根据cell的位置是top、middle、bottom和single来贴不同的自定义背景图了。

ps: 如果只要去掉某个cell的背景和边框,可以对某个cell调用:

cell.backgroundView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
 
 
posted @ 2013-04-25 20:46  zysyyz  阅读(293)  评论(0编辑  收藏  举报