iPhone:UINavigationController 顶部的奇怪空间

2023-06-12移动开发问题
3

本文介绍了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 顶部的奇怪空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

如何将 32 位 PNG 转换为 RGB565?
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)...
2024-08-12 移动开发问题
21

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7