Ste*_*fan 2 iphone cocoa-touch uitabbarcontroller uikit
我在我的AppDelegate中,我使用:
ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]];
UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController];
[self.tabBarController setSelectedIndex:0];
[self.tabBarController setSelectedViewController:acNavController];
Run Code Online (Sandbox Code Playgroud)
切换我的TabBarController中的视图.结果是靠近窗口顶部:
替代文字http://img.skitch.com/20090718-tpgya2nt4yeadacgs54dh8syp2.png
如何让我的观点找到正确的位置?
问候
Aak*_*rns 10
这是真正的答案. 之前的点(void)实际上是一个破折号.
- (void)viewWillAppear:(BOOL)animated {
// to fix the controller showing under the status bar
self.view.frame = [[UIScreen mainScreen] applicationFrame];
}
Run Code Online (Sandbox Code Playgroud)