状态栏与 ViewController 重叠
我在 AppDelegate 中使用:
ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]];
UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController];
[self.tabBarController setSelectedIndex:0];
[self.tabBarController setSelectedViewController:acNavController];
切换 TabBarController 中的视图。 结果是关闭窗口顶部:
alt text http://img.skitch.com/ 20090718-tpgya2nt4yeadacgs54dh8syp2.png
如何让我的视图到达正确的位置?
问候
I in my AppDelegate, I use:
ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]];
UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController];
[self.tabBarController setSelectedIndex:0];
[self.tabBarController setSelectedViewController:acNavController];
To switch the views in my TabBarController. The result is to close to the window top:
alt text http://img.skitch.com/20090718-tpgya2nt4yeadacgs54dh8syp2.png
How do I get my view to correct position?
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是真正的答案。
(void) 之前的点实际上是破折号。Here is the real answer.
The dot before (void) is actually a dash.检查视图的大小是如何在界面生成器或代码中定义的。 确保它占分配给状态栏的20个像素,即高度不应超过460。
check how the size of the view is defined either in interface builder or in your code. Make sure it accounts for the 20 pixels allocated to the status bar, that is the height should be no more than 460.
在 Interface Builder 中,确保视图属性中“模拟界面元素”下的“状态栏”未设置为“无”。
In Interface Builder, make sure "Status Bar" is not set to "None" under "Simulated Interface Elements" in the view's attributes.
解决方案是在旧的 UINavigationViewController 中加载 UIViewController。 这样 UIViewController 就会保持原来的位置。 感谢您的帮助
The solution was to load the UIViewController in the old UINavigationViewController. This way the UIViewController keeps its former position. Thanks for your help