UITabBar 出现向下 20 像素? [英] UITabBar appears 20 pixels down?

查看:20
本文介绍了UITabBar 出现向下 20 像素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 UITabBarController 并添加到 UIViewController 子视图.
我的代码以编程方式实现.UITabBar 显示在视图下方 20 像素处.

I have created a UITabBarController and adding to a UIViewController subview.
My code is implemented programmatically. The UITabBar is showed up 20pixels down the view.

UITabBarController *tabCtrl_obj = [[UITabBarController alloc]init];
[self.view addSubview:tabCtrl_obj.view];

我该如何解决?

推荐答案

是状态栏在做这件事.有时,如果您直接向窗口添加视图,它的行为可能会很奇怪 - 通常这意味着您必须自己定义视图的更多元素.尝试将视图的大小减小 20 像素(可能减少到 460),然后删除界面构建器中的模拟状态栏.您以编程方式做了多少?

It's the status bar that's doing it. Sometimes if you add a view directly to the window it can behave oddly - generally it means you have to define more elements of the view yourself. Try reducing the size of your view by 20 pixels (probably to 460) and then removing the simulated status bar in interface builder. How much are you doing programmatically?

这篇关于UITabBar 出现向下 20 像素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆