一,
UITableViewStylePlain类型的UITableView去除边框线有直接的属性方法:
separatorStyle = UITableViewCellSeparatorStyleNone;
但在UITableViewStyleGrouped类型的UITableView中,该方法无效!
如何去除边框线呢?答案很简单:
separatorColor=[UIColor clearColor];
二,
在UITableViewStyleGrouped这个类型下, tableView会有一个高度是35的组间距,也就是viewForHeader中的view的高度.重新设置一下这个view就好了.
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 1;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 1)];
view.backgroundColor = [UIColor clearColor];
return view;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 1)];
view.backgroundColor = [UIColor clearColor];
return view;
}