1.以前说到,可以设置tableview空白的部分不再显示分割线,self.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 或者 self.tableFooterView = [UIView new];
但最近发现一个问题,如果我们分别设置tableview的头和尾,self.tableHeaderView = self.headView; self.tableFooterView = self.footView; 这样设置没有问题,可是顺序倒过
来,self.tableFooterView = self.footView; self.tableHeaderView = self.headView; 你会发现莫名其妙多了一条顶格的小灰线停留在底部,不同于默认的分割线,怎么都消不去。。。。
2.还有设置cell分割线顶格,
self.layoutMargins = UIEdgeInsetsZero;
self.preservesSuperviewLayoutMargins = NO;
//self在这里是一个tableview的子类对象
以及设置cell.tintColor = [UIColor RedColor];//这个可以用来设置cell右侧的accessoryView的颜色
上面的设置方式,当我们对于这样创建出来的cell,并没有任何作用
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
}
对于UITableViewCellStyleValue1风格的cell不好使,其他的还没去一一尝试,自己可以去试一下,感觉挺奇怪的 。。。。WTF
UITableViewCellAccessoryType