小编Ale*_*lex的帖子

更改UINavigationController内的视图高度

我想更改a UIViewController's内部视图的高度,UINavigationController以在底部显示横幅,这样就不会遮挡任何内容.

我认为只需更改视图的框架就可以轻松实现,viewDidLoad但这样做不起作用:

CGRect frame = self.view.frame;
self.view.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height - 49.0f);
Run Code Online (Sandbox Code Playgroud)

我也尝试添加

[navigationController.view setAutoresizesSubviews:NO];
Run Code Online (Sandbox Code Playgroud)

在启动后UINavigationController它仍然看起来一样.

我现在能想到的唯一选择就是在UINavigationController里面使用一个UITabBarController被横幅遮挡的假人,但这似乎对我来说不必要的复杂.

有没有办法改变视图控制器的视图高度UINavigationController

iphone uiviewcontroller uinavigationcontroller ios

6
推荐指数
1
解决办法
4173
查看次数