Adding a TabBarController as the Subview of a View

后端 未结 2 446
抹茶落季
抹茶落季 2021-02-01 11:35

I am loading a splash screen when my app starts. Then I want to load a TabBarController and it\'s ViewControllers. However, my TabBarController window does not scale to the

2条回答
  •  天涯浪人
    2021-02-01 12:04

    I finally found someting that works. Instead of:

    tabBarController.view.frame = [[UIScreen mainScreen] applicationFrame];
    

    or

    tabBarController.view.bounds = [[self view] bounds];
    

    Because I couldn't find and automatic or named settings for this size, I had to create my own rectangle that is the size of the screen minus the statusBar.

     tabBarController.view.frame = CGRectMake(0,0,320,460);
    

提交回复
热议问题