Callum Jones
Callum Jones

Reputation: 595

Separator insets not working

I have a UITableView in a Storyboard where I have configured the Separator Inset to custom (0,0) as well as for the Prototype Cell (0,0).

While I can see the separator line is now 100% the width of the table, the UIImageView (subclassed to AsyncImageView) is still positioned to the right by 15px.

I've tried setting it on the table view on load and when the cell is constructed from a dequeue but I'm still seeing a padding on the left. (I've queried the cell and table and the inset and frame has zero left padding).

Is there anything I'm missing?

Upvotes: 0

Views: 1469

Answers (1)

Andyy
Andyy

Reputation: 495

You have to subclass UITableViewCell and call layoutSubviews from your newly created UITableViewCell class, in the layoutSubviews method, use

- (void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.frame = CGRectMake(0, 0, 50, 50); // override frame of your choice
}

Upvotes: 3

Related Questions