search

Home  >  Q&A  >  body text

iOS UITableView 实现去除Section的分割线,保留Cell的分割线

阿神阿神2772 days ago2081

reply all(5)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 13:19:59

    First of all, I think you need to set the background color first, so that you will not confuse the dividing line of the section or the background color of the tableview
    Usually when we are making custom cells or section headers and footers, we try to replace them with a view with a height of 1-3 points, so that we have more space to control. It’s what we usually call a blindfold
    If you still can’t solve it, it’s best to post the code

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:19:59

    + (void)hideEmptySeparators:(UITableView *)tableView
    {
      UIView *v = [[UIView alloc] initWithFrame:CGRectZero];
     [tableView setTableFooterView:v];
    }
    

    lz Can you try calling this code during viewDidLoad?

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:19:59

    I use iOS8 SDK, the default is the effect you need:

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:19:59

    tableview changed to plain

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:19:59

    Set the tableView of separate style to 成none, and then add a custom bottom line in the custom cell. This is the method I use!

    reply
    0
  • Cancelreply