如何去除UITableViewStyleGrouped类型的UITableView的边框线

2025-05-18 07:03:20
推荐回答(2个)
回答(1):

_tableView.backgroundView=nil;可以搞定。测试下发现确实可以,但是不知道以前的版本不确定有没有backgroundView的,所以最好加个判断吧:if(mainTableView.backgroundView){mainTableView.backgroundView=nil;}如果类型为UITableViewStylePlain,[UIColorclearColor]仍然有效,怪哉!正常情况下grouped样式(UITableViewStyleGrouped)UITableViewCell都是有边框的,如果要去掉边框可以用:UIView*tempView=[[[UIViewalloc]init]autorelease];[cellsetBackgroundView:tempView];其实很简单,把backgroundView设置为一个空的View,然后就干净了。

回答(2):

separatorColor=[UIColor clearColor];