1

I have a UITabBar app that I build using xib in IB. In my view on IB, it has the bottom bar. In the following image, the bottom bar is just under the UIToolBar. It is under the toolbar, because I have no option to put it on top of the bar.
enter image description here

When I run the app, the toolbar appears in the middle of the screen as shown here. How can I fix that? I want it to be between the tab bar and the web view.

enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user717452
  • 33
  • 14
  • 73
  • 149

1 Answers1

0

You need to set some Auto Layout constraints or an autoresizing mask in Interface Builder to tell your toolbar how to position itself.

Update: Assuming I understand what you're trying to do, try these constraints:

Web view: 0 distance from top and sides, (height of tab bar + toolbar) from bottom.

Toolbar: 0 distance from sides, default (or some constant) height, (height of tab bar) from bottom.

Tab bar: 0 distance from sides, default (or some constant) height, zero distance from bottom.

Community
  • 1
  • 1
Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
  • I tried auto layout...pinned it to the bottom set = 50 and it placed it on top of the bottom layout guide, made it look stretched out, and web view still went behind it. – user717452 Nov 26 '13 at 16:37
  • Still stuck with the ToolBar up half the screen. It has something to do with the way the new Xcode shows the tabs. On old way, you would see the tab bar controller, and just drag and drop and that's where it would appear. It now has top and bottom guides that I can't get rid of, and instead of the whole tab bar, when I click a view controller, I only see that view, with a space for where tab would be. If you put toolbar over it...well, it won't let you, and if you go over it puts it halfway up screen. Even setting AutoLayout to 0 from bottom it will still mess up – user717452 Nov 26 '13 at 17:50
  • I don’t use IB much, but in iOS 7 there is a new property on `UIViewController` called [`-edgesforExtendedLayout`](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/AppearanceCustomization.html). You might want to look in IB to see if there’s a way to edit this property graphically. – Zev Eisenberg Nov 26 '13 at 21:03