0

I have a view that manages a UIPageController and it's child views. In my parent view, I have a navigation bar and bottom tab bar. Then in the child page views, I shortened the top and bottom so the top and bottom nav shows through using this code:

self.pageViewController?.view.frame = CGRect(x: 0, y: 65,
            width: self.view.frame.width, height: self.view.frame.size.height - 114)

This makes the top and bottom bar show like the attached image below. However, I'd like to change this approach and make the child page views full screen but "z-indexed" behind the top and bottom bars so it becomes translucent over the full page image. Is this possible?

enter image description here

TruMan1
  • 33,665
  • 59
  • 184
  • 335
  • To manage the frame of pageViewController is preferred to use constraints (for this case the topLayoutGuide and bottomLayoutGuide) http://stackoverflow.com/a/29589531/2477632 . To make navigationBar transparent : http://stackoverflow.com/a/18969823/2477632 hope that helps – HamzaGhazouani May 05 '15 at 18:12
  • Good idea, but unfortunately this disabled all constraints on the view, including labels, images, etc. – TruMan1 May 05 '15 at 18:44
  • Only thing I can think of at this point is setting the background image of the parent view. – TruMan1 May 05 '15 at 18:59

1 Answers1

0

Have you tried using topLayoutGuide? This fixed it for me for my other childViewControllers.

override func viewDidLayoutSubviews() {
    someView.contentInset.top = topLayoutGuide.length          // For navigationBar
    someView.contentInset.bottom = bottomLayoutGuide.length    // For toolBar
}
Eendje
  • 8,815
  • 1
  • 29
  • 31
  • This is sizing the child views but not changing the z-index of the nav and bottom bar. Unless I'm doing this in the wrong place (I did it in the child views). – TruMan1 May 05 '15 at 18:59