Space between custom UITabBar and ViewController

前端 未结 4 1210
抹茶落季
抹茶落季 2021-02-09 20:34

I took a regular UITabBar and changed it\'s background image to a custom one which has a lower height, so I changed the height of the frame

相关标签:
4条回答
  • 2021-02-09 21:06

    I tried by changing the height and origin of tabbar, for me it worked properly.You can try by increasing the height of your viewcontroller.

    0 讨论(0)
  • 2021-02-09 21:08

    If changing the frame like @JoaT mentioned doesn't work make sure the view controller's view has the correct autoresizing mask set.

    This SO link may be helpful.

    0 讨论(0)
  • 2021-02-09 21:09

    Change your UITabBarController's subviews to a full-sized frame, this worked for me:

    [[yourTabBarController.view.subviews objectAtIndex:0] setFrame:CGRectMake(0, 0, 320, 480)];
    
    0 讨论(0)
  • 2021-02-09 21:28

    Try creating your own class extending from UITabBar and use this function:

    - (CGSize)sizeThatFits:(CGSize)size {
        CGSize auxSize = size;
        auxSize.height = 54; // Put here the new height you want and that's it
        return auxSize;
    }
    

    This will resize the UITabBar to the size you want. Simple and easy.

    0 讨论(0)
提交回复
热议问题