Space between custom UITabBar and ViewController

前端 未结 4 1212
抹茶落季
抹茶落季 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: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.

提交回复
热议问题