I have a tableview that I create in code. Previously, I assigned it absolute coordinates but as I switch over to autolayout in Storyboard- I don't know how to link it to the element above it.
Basically, the tableView is supposed to be a subview of the container view and it is supposed to be about 12 points below a textField. Can anyone suggest correct way to do this?
This is how I currently create and position the tableview.
_autocompleteTableView = [[UITableView alloc] initWithFrame:
CGRectMake(20, 200, 280, 300) style:UITableViewStylePlain];
[self.view addSubview:_autocompleteTableView];
The constraints in storyboard for the textfield above it are:
textfield.leading = superview.leading+20
textfield.trailing+20 =superview.trailing
textfield.top = elementAbove.bottom+12
textfield.height=30;
Thanks for any suggestions.