5

After I moved to iOS 7 / xcode 5, the hidden border of the sections appeared although I handled this case for iOS 6 and it worked for me.

In my code I'm using this to make the section border hidden, which works on iOS 6 but not on iOS 7:

cell.backgroundView =[[UIView alloc] initWithFrame:CGRectZero];

I tried all answers in this question and this one but no answer worked for me.

Please advice.

Community
  • 1
  • 1
Sawsan
  • 1,096
  • 10
  • 20

3 Answers3

7

It seems that the separator between cells in a single section is the same as the border for the sections in IOS7. I solved my problem by setting the separator attribute of my table in Interface Builder to None and drawing the separator lines manually for the sections that have more than one cell.

Kevin
  • 53,822
  • 15
  • 101
  • 132
Sawsan
  • 1,096
  • 10
  • 20
0

What about implementing and playing with the header view:

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
Tarek Hallak
  • 18,422
  • 7
  • 59
  • 68
  • what should I do with it if I want to remove the border of the section? – Sawsan Sep 30 '13 at 08:22
  • 1
    Try to create a white view and return it in that delegate, if it doesn't work then it means that this border doesn't come from the section:(. – Tarek Hallak Sep 30 '13 at 08:28
  • Set the table separator to None instead of default solved the problem for me! My question: is the separator the same as border for the grouped table in IOS7? – Sawsan Oct 01 '13 at 06:48
  • It seems yes since it is gone when you disable the separator. – Tarek Hallak Oct 01 '13 at 08:49
  • OMG! then how can I keep the separator in the section that has multi cells? I need the separator between them in a certain section – Sawsan Oct 01 '13 at 11:58
0

I just solved a similar problem myself.

In my case the section which I don't want section border has only one cell which is not data driven (in my case, a button). So I simply get rid of the section, and make a custom view to represent the content in that cell, then assign the custom view as the footer of the previous section.

It works for both iOS6/7 (of course) so I thought it would be good to put it here if anyone could use it.

axl411
  • 920
  • 1
  • 7
  • 23