0

The tab bar controller formatting incorrectly, instead of showing the entire iPhone screen its coming off as a rectangle

how can I fix that?

enter image description here

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
  • It seems you have presented modally the `UITabBarController`, but not with the option fullscreen (since iOS13 if I remember correctly). So, how is shown the TabBar? By code? By segue? Set the correct option `modalPresentationStyle` – Larme Oct 07 '21 at 18:36
  • Does this answer your question? [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen) – Larme Oct 07 '21 at 18:36
  • I have used the LoginViewController as a method of presenting the MainTabbarController which holds my 5 view controllers within that TabbarViewController. This is my code below but I am unsure if I shiuld be using the Login View Controller to show my Tab Controller – Wens Music Oct 07 '21 at 19:12
  • class LoginViewController : UIViewController { @IBAction func LoginTapped(_ sender: Any) { let mainTabController = storyboard?.instantiateViewController(withIdentifier: "MainTabController") as! MainTabController mainTabController.selectedViewController = mainTabController.viewControllers?[0] present(mainTabController, animated: true, completion: nil) } } – Wens Music Oct 07 '21 at 19:12
  • 1
    See the related question in the comment, you'll see what you are missing: `modalPresentationStyle` to set. Also, it's better to put code in question (edit) instead of comment, where it's hard to read – Larme Oct 07 '21 at 19:13
  • Thank you that worked! before just set it to present but I didn't add the modelPresentationStyle set to full screen ive been trying to do this all week so I thank you greatly for your help! – Wens Music Oct 08 '21 at 01:59
  • modalPresentationStyle = .overFullScreen modatTransitionStyle = .crossDisolve //and much more – Zeeshan Ahmad II Oct 12 '21 at 07:47

0 Answers0