0

I have several different tableviewcontrollers connected to tabs. All were created in storyboard.

For all but one, I don't have a search bar. For one, however, I do have a search bar. When you view the one with the searchbar the table view does not take up the whole space at the bottom. At the top it shows the search bar as you would expect. But at the bottom, it leaves empty space.

enter image description here

In the measurement inspector for the storyboard, the view controller appears to have the same dimensions 600x600 as the tableview for the other view controllers.

Some answers suggest that the table row height may differ with the search bar controller but I tried changing that and it did not have any effect. Can anyone suggest what might be causing this problem?

user1904273
  • 4,562
  • 11
  • 45
  • 96
  • For your table view controller do you have Extend Edges under bottom and bottom opaque bars selected? It looks like either the bottom layout guide is being confused, or it has the height correct but has forgotten to shift the table view down to take into account the search bar. Is it OK in this controller if you disable the search bar? You could use the 3D view debugger to look at what is being layed out. – Rory McKinnel Sep 02 '15 at 08:32
  • tried with and without extended edges and opaque...no difference. There is no bottom layout visible storyboard outline. I don't seem to have a 3D view debugger button. Have the paper airline and then the icon for the app with nothing in between. Running it on external iPhone. How can I launch 3d debugger? – user1904273 Sep 02 '15 at 14:33
  • For the 3D viewer it will need to be run in the simulator on iOS8+. The icon is a cross shape made from two rectangles across each other. It is to the right of the Step In, Step Out arrows just before the paper airline. – Rory McKinnel Sep 02 '15 at 14:37
  • Another thing to try is setting `self.definesPresentationContext = YES` in your table view controller. That seems a common issue with search bars. – Rory McKinnel Sep 02 '15 at 14:44
  • For simulator, my Xcode does not show that as an option. Only goes to 7.1. For self.definesPresentationContent, where should this go? Tried it in viewdidload but did not change anything. – user1904273 Sep 03 '15 at 18:43
  • `viewDidLoad` was ok, so I guess it has no effect. Surprised you can't see the 3D viewer. Should show when you run a debug version on iOS8 or higher. See http://stackoverflow.com/questions/25963257/how-to-get-the-3d-view-of-ui-in-xcode-6 – Rory McKinnel Sep 03 '15 at 18:57

0 Answers0