Modalviewcontroller加載後顯示間隙。 Gap在移動了modalviewcontroller的staus bar之後,差距顯示了我的主窗口。所以我怎樣才能消除狀態欄和模態控制器之間顯示的這個差距。沒有介入構建器。以編程方式創建一切。幫助這將非常感激。modalviewcontroller加載後顯示間隙
UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];
[button addTarget:self action:@selector(displayModalViewaction:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:button];
- (void)displayModalViewaction: (id) sender
{
self.viewController = [[Infoviewcontroller alloc] init];
UINavigationController *navigationController=[[UINavigationController alloc] init];
navigationController.navigationBar.tintColor = [UIColor brownColor];
[navigationController pushViewController:_viewController animated:YES];
[self.view addSubview:navigationController.view];
}
感謝
這段代碼在哪類中?它在UIViewController中嗎? – jaminguy 2012-01-11 16:35:25
是的,它是一個UIViewController。找到desiredfullsizelayout,但這對於視圖應該與狀態欄重疊。 – user1120133 2012-01-11 16:39:59
你需要發佈更多的代碼,以便我們可以看到你做錯了什麼。你的didFinishLaunchingWithOptions:實現看起來像什麼?在此之前有多少其他視圖控制器被創建,以及應用程序流是什麼樣的? – jaminguy 2012-01-11 20:10:41