How to hide tab bar programmatically and then expand view to fit

前端 未结 5 688
余生分开走
余生分开走 2021-01-15 11:39

I got the code from this question: How to hide UITabBarController programmatically? which is brilliant, however the view doesn\'t expand to fit the space left by the tab bar

5条回答
  •  难免孤独
    2021-01-15 11:49

    in NSContraints era, do NOT try to modify frame by code, bad things may happen.

    Use: pushedViewController.hidesBottomBarWhenPushed = YES;

    typically set hidesBottomBarWhenPushed to yes in prepareforSegue, ANYWAY before iOS actually pushes the new controller.

提交回复
热议问题