Reputation: 14123
I am trying to set constraints on UITableView using storyboard. In Editor -> Pin option, constrains are disabled.
Why aren't they enabled ?
Update: Gabbler's observation correctly states that tableView is the topmost view, you don't have to do the pin action on it. My purpose of setting constraints was to void leading space to tableView which comes by default when applications runs. Please check the screenshot :
Upvotes: 0
Views: 172
Reputation: 13766
What you are looking for is separatorInset
and layoutMargins
. In viewDidLoad
:
self.tableView.layoutMargins = UIEdgeInsetsZero;
self.tableView.separatorInset = UIEdgeInsetsZero;
And add this method.
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
Upvotes: 1