cell.selectionStyle = UITableViewCellSelectionStyleNone;//让cell不能选中
//从新设置cell的背景,可以让cell分割线消失
UIView *tempView = [[UIView alloc] init];
tempView.backgroundColor=[UIColor whiteColor];
[cell setBackgroundView:tempView];
//也可以让分割线消失
_saleTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
//在每行加分割线
- (void)drawRect:(CGRect)rect
{
CGFloat gap = (ScreenWidth > 350 ) ? 15 : 10;
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor lightGrayColor].CGColor);
CGContextStrokeRect(context, CGRectMake(gap, rect.size.height , rect.size.width - gap * 2, 1));
}
//tableview style不同的区别
style=UITableViewStyleGrouped 默认会有headview和footview,头尾会空出一些距离,headview和footview会随tableview一起滑动,
style=UITableViewStylePlain 默认没有headview和footview,自定义的headview和footview不会随tableview一起滑动,
_saleTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, FRAMEW(self.view), FRAMEH(self.view) - 56 - 64) style: UITableViewStyleGrouped];
_saleTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, FRAMEW(self.view), FRAMEH(self.view) - 56 - 64) style: UITableViewStylePlain];