我在应用程序委托中启动应用程序期间使用多个控制器。一个控制器用于注册,第二个控制器是tabbar。 tabbar加载正常,但是当我将注册控制器推到窗口上时,内容增加了20个单位,底部有好的白色空白屏幕。因此,我在其viewdidload方法中重新创建了注册视图控制器的框架,并将其向下滑动了20个单位。该代码是当推送时,ViewController在屏幕下方留下20px白色
self.view.frame = CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height);
和代码在我的应用程序委托启动应用程序是
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if (![self accountExists]) {
//code if account does not exists on iphone app database
self.registerAccount = [[registerViewController alloc] initWithNibName:@"registerViewController" bundle:nil];
[window addSubview:registerAccount.view];
}
else if([self autoLoginForAnyAccount]){
//code for autologin to app
}
else {
self.tabBarController.selectedIndex = 1;
self.tabBarController.delegate = self;
[window addSubview:tabBarController.view];
}
[window makeKeyAndVisible];
return YES;
}
,如果有人知道为什么会出现在底部是白色空间时,登记控制器推然后请与我分享。
你现在知道原因吗?我正在同样的问题上挣扎。 – Hemant 2011-01-13 14:43:51