Note that there are some explanatory texts on larger screens.

plurals
  1. POTab bar controller not appearing correctly
    primarykey
    data
    text
    <p>I'm trying to connect Tab Bar Controller to existing part of my app, but when I do that it's "malfunctioning". </p> <p>However when I run Tab Bar Controller part standalone as initial view controller it works properly like in the image below :</p> <p><img src="https://i.stack.imgur.com/IZrwB.png" alt="enter image description here"></p> <p>This is how app looks when it is run(correct behavior) :</p> <p><img src="https://i.stack.imgur.com/B4ZFm.png" alt="enter image description here"></p> <p>However when I go to this tab bar controller from my main app this is how it looks like this:</p> <p><img src="https://i.stack.imgur.com/iXV7D.png" alt="enter image description here"></p> <p>My main app looks like this :</p> <p>Scroll View contains</p> <ul> <li>UIView 1</li> <li>UIView 2</li> <li>UIView 3</li> <li>UIView x</li> </ul> <p>Each view does something not related to this tab bar controller. Only one view view x tries to "visit" tab bar controller and display some data there, but it's not. Any ideas?</p> <p>I have this tab bar controller identifier set to test, and I here is how I do that from my view x :</p> <pre><code>UITabBarController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; [self.view addSubview:newViewController.view]; </code></pre> <p><strong>EDIT :</strong></p> <p>Entire app :</p> <p><img src="https://i.stack.imgur.com/k8spx.png" alt="enter image description here"></p> <p>I'm creating views programatically. That's why I don't have any relationships/segues to the tab bar controller.</p> <p><strong>SOLUTION :</strong></p> <p>Change :</p> <pre><code>UITabBarController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; [self.view addSubview:newViewController.view]; </code></pre> <p>To :</p> <pre><code>UITabBarController *newViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; [self addChildViewController:newViewController]; [self.view addSubview:newViewController.view]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload