0

I have a grouped UITableView with 3 sections, a section header only on section 1, 3, 2, and 5 cells in the sections. When scrolling, the border lines sometimes.

The cells of the table view is a custom cell with a label and a text field. It does not set the cell view background color.

There is no background view or color specified -- all standard.

Typically the borders disappear for the last 2 rows of the last section, and the 2 rows of the 2nd section, but I've seen them all disappear at one point or another.

This is an app where the user enters data in each row. Typically if they just go row by row it works fine, but if they scroll around it fails!

This is happening with Xcode 4.3.2 and iOS 5.1.1. Happens on both iPhone and iPad, but app has been designed so that little scrolling necessary on iPad.

I can't see how this is not an Apple bug, but I'd love for someone to prove me wrong!

The following screen shows the text of the section header, the 2nd group, and the 1st 3 cells of the 3rd group. Note the missing lines!

3
  • A screenshot would help a lot. Is it possible that your label or the text field is covering outside of the cell and hiding the borders? Commented May 22, 2012 at 0:45
  • Are you adding the label and the text field to the contenView of the cell? It looks like this can only happen if you add them to the cell directly. Commented May 22, 2012 at 8:08
  • The label and text field are added to the contentView in the initWithStyle method of the UITableView, i.e., [self.contentView addSubview:lblTitle]; Their postions are set in the layoutSubviews method with hard-coded values. lblTitle.frame = CGRectMake(5, 10, 100, 21); txtData.frame = CGRectMake(110, 10, self.contentView.bounds.size.width - 115, 31); Commented May 22, 2012 at 15:38

1 Answer 1

0

My cellForRowAtIndexPath method contained a:

cell.backgroundView = nil;

Removing that statement made the lines view correctly.

If I recall correctly, I added that to change the background color of the cell. I now use:

cell.backgroundColor [UIColor white];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.