0

I added a bottom border to a uitableviewcell programmatically (iPhone - Create custom UITableViewCell top and bottom borders):

UIView *bottomLineView = [[UIView alloc] initWithFrame:CGRectMake(0, cell.bounds.size.height, self.view.bounds.size.width, 1)];
bottomLineView.backgroundColor = [UIColor grayColor];
[cell.contentView addSubview:bottomLineView];

It's not displaying on an ipad unless you highlight it. All the other cells below and above it have the background color set to clear.. It displays fine on the iPhone

Community
  • 1
  • 1
Tim Nuwin
  • 2,775
  • 2
  • 29
  • 63

1 Answers1

0

Move the line one pixel up. Right now it's outside of the frame, getting overlayed by the next cell.

UIView *bottomLineView = [[UIView alloc] initWithFrame:CGRectMake(0,
                               cell.bounds.size.height - 1, 
                               self.view.bounds.size.width, 
                               1)];
Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143