1

I want my tableview cell to have colored border and rounded corners. Thats what i tried:

 // Color [cell.contentView.layer setBorderColor:[UIColor colorWithHexString:@"dbd7d7"].CGColor]; // Rounded corners [cell.layer setCornerRadius:7.0f]; [cell.layer setMasksToBounds:YES]; [cell.layer setBorderWidth:2.0f]; cell.layer.borderColor = [UIColor colorWithHexString:@"dbd7d7"].CGColor; 

However, there is odd "white triangles" on right and left borders. Please take a look:

enter image description here

How to fix that?

1
  • look at the view debugger, and see what's behind that layer. Ther must be one view behind the border. MAke that view background color as clear color Commented Jan 5, 2016 at 21:49

2 Answers 2

1

Make sure the table view's background color is clear and check that cell.opaque = NO;

Sign up to request clarification or add additional context in comments.

2 Comments

cell.backgroundColor = [UIColor clearColor]; cell.opaque = NO; not helped((
not cell background, the answer says to set table background color @EvgeniyKleban
1

In your viewDidLoad method

[self.tableView setBackgroundView:[[UIView alloc] init]]; [self.tableView setBackgroundColor:UIColor.clearColor]; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.