How do I remove the borders of a UITableView?

后端 未结 6 1257
别跟我提以往
别跟我提以往 2020-12-04 16:39

I have subclassed the UITableView control, and the style is grouped, but I do not need the cell separators. I tried setting my table view\'s separatorStyle to none, but it

相关标签:
6条回答
  • 2020-12-04 16:46

    To remove the border of a table view write this line:

    self.myTableView.separatorColor = [UIColor clearColor];
    

    If you want to remove both the border of a table view but the border between cells too, you have to write both lines:

    self.myTableView.separatorColor = [UIColor clearColor];
    self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    0 讨论(0)
  • 2020-12-04 16:48

    In a grouped table view, setting separatorStyle doesn't do anything. If you want to hide it, just do the following:

    tableView.separatorColor = [UIColor clearColor];
    
    0 讨论(0)
  • 2020-12-04 16:48

    This did the trick for me:

    [dayTableView setSeparatorColor:[UIColor whiteColor]]; //or your background color
    
    0 讨论(0)
  • 2020-12-04 16:57

    How about setSeparatorColor to your cell's background color?

    0 讨论(0)
  • 2020-12-04 17:03

    Use this

    tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    0 讨论(0)
  • 2020-12-04 17:03

    swift 4 use

    myTableView.separatorStyle = UITableViewCellSeparatorStyle.none
    
    0 讨论(0)
提交回复
热议问题