luky
luky

Reputation: 2370

UITableViewCell separator insets 0 not exactly to left border?

I wonder why if i set (in storyboard custom separator insets left = 0, right = 0) why there is still space on the left side and it is not exactly to the left border?

As you can see, right side is exactly at border.

enter image description here

Upvotes: 1

Views: 40

Answers (2)

Arun
Arun

Reputation: 1411

Try this :-

Add this where you are declaring your table view

[self.tableView setContentInset:UIEdgeInsetsZero];
// Set seperator to start from zero
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)])
    [self.tableView setSeparatorInset:UIEdgeInsetsZero];

And add this in your cellForRowAtIndexPath method

cell.layoutMargins = UIEdgeInsetsZero;
cell.preservesSuperviewLayoutMargins = NO;

Upvotes: 1

Sanjukta
Sanjukta

Reputation: 1055

Please add this in your code and run the project. enter image description here

Upvotes: 0

Related Questions