iPhone:UINavigationController 顶部的奇怪空间 [英] iPhone: Weird space at the top of UINavigationController

查看:14
本文介绍了iPhone:UINavigationController 顶部的奇怪空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将 UINavigationController 添加到我的 iPhone 应用程序时遇到了一个奇怪的问题.我添加控制器如下:

I'm having a strange problem with adding a UINavigationController to my iPhone application. I add the controller as follows:

myViewController *viewController = [[myViewController alloc] initWithNibName:@"myView" bundle:nil];

myNavigationViewController *navigationController = [[myNavigationViewController alloc] initWithRootViewController:viewController];

UIView *finalView = myeNavigationViewController.view;

[self.view addSubview:finalView];

一切似乎都按计划进行,只是在状态栏和 UINavigationController 标题栏之间的视图顶部出现了一个奇怪的空白.替代文字 http://www.andrewskinner.name/problem.png

All seems to work as planned except I get a weird white space at the top of my view between the status bar and the UINavigationController title bar. alt text http://www.andrewskinner.name/problem.png

我在网上搜索过,但不知道要搜索什么.有没有其他人有这个问题?你能给我指明一些帮助的方向吗?

I've searched online but don't really know what to search for. Has anyone else had this problem? Can you point me in the direction of some help?

提前致谢.

推荐答案

查看这个问题的答案:

不知道为什么 UIView 被轻推增加约 10 像素

这篇关于iPhone:UINavigationController 顶部的奇怪空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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