iOS 去掉tableview的cell線

整體去掉cell的線

    tableView.separatorStyle = UITableViewCellSelectionStyleNone;

去掉tableview多餘的cell線

tableview行數比較少的情況,會導致空的地方也還是會有cell線

    tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

去掉特定的cell線

根據需求去掉某些行的線

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//第0行的cell線去掉
if(indexPath.row == 0){
 cell.separatorInset = UIEdgeInsetsMake(0,SCREEN_WIDTH, 0, 0);
 }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章