1

Both my UITableView and searchResultsTableView have a clear background color. How can I hide the normal UITableView when I'm typing into the search bar of the searchResultsTableView? I've tried hiding tableView, but it hides both tableviews. See my interface builder setup below: enter image description here

I've also read the post here: Hide UITableView when searchResultsTableView displayed However, my Search Display Controller is not being added to the tableview, only the Search Bar is. So I'm not sure how to fix this issue.

Any help is appreciated. Thanks!

1 Answer 1

1

You can use the method [subView removeFromSuperview] in this case. Whenever there is a need to display the searchResultsTableView just remove the UITableView from the superview and add the searchResultsTableView in place of that by using method [self addSubview:searchResultsTableView]

Sign up to request clarification or add additional context in comments.

2 Comments

Where would I add that?
The Search Display Controller has been deprecated in iOS 8. This may or may not inform your decision to keep working on this problem or try to achieve the same goal with the new search controller.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.