Search code examples
iosuitableviewuisearchbaruisearchdisplaycontroller

Issue with UISearchBar frame


I have a UITableView which I programatically create and I have added a UISearchBar/UISearchDisplayController as a subview. It looks like this:

enter image description here

That's all fine but when I touch it to invoke searching the frames changes strangely, any idea why?

enter image description here

I've tried manually setting the frame, doesn't seem to help.

The UITableView is a property of a UIViewController.


Solution

  • I think it is a duplicate of this question UIsearchBar. Can't change frame.

    The answer being that you can't mess with UISearchBar's frame.