title: pageviewcontroller inside navigation controller causing layout problems
body: <p>I have a UIViewController (using Swift)</p>
  
  <p>It is just a simple list of Items. It is implemented as a UIViewController to which I have added a UITableView.  This 'Items' view is invoked via this code in my slide menu implementation, and the initial view of the slide menu is embeded in a NavigationController - so all the views in the slide menu take on the navigation controller.  Items is one of those slide menu views invoked like this</p>
  
  <pre><code>self.openViewControllerBasedOnIdentifier("Items")
  </code></pre>
  
  <p>This works fine and I get....</p>
  
  <p><a href="https://i.stack.imgur.com/EjM7P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EjM7P.jpg" alt="Initial Lists view from slider menu"></a></p>
  
  <p>I then have an add button in the top right that you can push to add new Items.  The add button brings up a PageViewController.  I use page view because there are multiple pages of details associated with the Item being added.  This also works so far in that I get the pageviewcontroller launched and I can flip between pages.</p>
  
  <p>The problem is that the placement of elements on the page shifts under some circumstances (it is not consistent).</p>
  
  <p>When I initially show the 1st page of the PageViewController I see the layout that I designed (on the left below). If I simply tab out of the Text field OR if I swipe to the 2nd page and then swipe back to the 1st page then I see the right image.  The whole view jumps up!  </p>
  
  <p>I tried flipping all the different settings in the storyboard regarding . I even moved the majority of the drawing in to the code and out of storyboard in order to manually set constraints.  These are the settings I played with.  tried lots of combinations but they are mostly all off now.</p>
  
  <p><a href="https://i.stack.imgur.com/pE5iJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pE5iJ.jpg" alt="enter image description here"></a></p>
  
  <p>Here is Before and After.  How do I stop the view from jumping up and down. Also, interesting is that if i swipe from page-3 to page-2 then page-2 is shifted up.  If I keep going back to page-1 and then swipe back to page-2 then page-2 is back down to correct position. So deepening on which way I enter page-2 it is different layout.  From 1 to 2, page 2 is correct.  From 3 to 2, page 2 is shifted up.</p>
  
  <p><a href="https://i.stack.imgur.com/nw06h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nw06h.jpg" alt="enter image description here"></a></p>
  
  <p>I can not get the layout to stay in one spot.</p>
  
  <p>The other option, is to just shut off NavigationController when in the page view controller and deal without having it.</p>
  
  <p>So...</p>
  
  <p>1) how can I stop the jumping - <strong>best case</strong></p>
  
  <p>2) how can I shut off navigation controller when pageviewcontroller is up - <strong>second option</strong></p>
  
  <p>The pages of my pageviewcontroller are invoked via this code</p>
  
  <pre><code> instantiateViewController(withIdentifier: "itemDetail\(num)ViewController")
  </code></pre>
  
  <p>Where 'num' is 1,2, or 3.  Using an indexed array and viewControllerBefore along with viewControllerAfter methods.  The paging itself works fine.</p>
  
  <p>Thanks</p>