gpt4 book ai didi

iphone - 状态栏与 ViewController 重叠

转载 作者:行者123 更新时间:2023-12-03 20:20:01 25 4
gpt4 key购买 nike

我在我的 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 中的 View 。结果是接近窗口顶部:

alt text http://img.skitch.com/20090718-tpgya2nt4yeadacgs54dh8syp2.png

如何将 View 调整到正确的位置?

问候

最佳答案

这才是真正的答案。 (void) 之前的点实际上是破折号。

- (void)viewWillAppear:(BOOL)animated {
// to fix the controller showing under the status bar
self.view.frame = [[UIScreen mainScreen] applicationFrame];
}

关于iphone - 状态栏与 ViewController 重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1147882/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com