0

I have a UISearchController and UITableView but they are showing up as blank on my screen.

[self.view addSubview:self.searchController.searchBar];
[self.view addSubview:self.tableView];

NSDictionary *views = @{@"searchBar": self.searchController.searchBar,@"tableView": self.tableView};
[containerView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[searchBar(>=44,<=88)]|" options:0 metrics:nil views:views]];

Not sure why it is blank? The search bar and table view are declared normally.

cdub
  • 24,555
  • 57
  • 174
  • 303
  • And you don't get an warning with these constraints? The search bar constraints are conflicting and you are not setting the constraints for the table view, nor the horizontal constraints. Also have you set the 'translatesAutoresizingMaskIntoConstraints' flag to no for both views? – Lefteris Nov 24 '15 at 08:17
  • Yes to maskintoconstraints to no. Why are they conflicting? - I really want to solve this: http://stackoverflow.com/questions/33842802/using-autolayout-programmatically-for-search-bar-and-uitableview – cdub Nov 24 '15 at 08:32
  • Been stuck. If I had scope bar the table view does not get moved down to the scope bar's bottom matching the table views top. The table view remains hidden under the scope bar – cdub Nov 24 '15 at 08:33
  • Can you share both the screen shot of your final output on simulator and what you are trying to achieve. – Gandalf Nov 24 '15 at 09:33
  • Chris I have replied to your other question. You should delete this one I believe – Lefteris Nov 24 '15 at 10:41

0 Answers0