UINavigationController within ViewController, gap at top of view

后端 未结 11 972
不知归路
不知归路 2021-02-04 03:24

I\'m working on a universal app, and I\'m trying to share as much code as possible between the iPhone and iPad versions. I need to use a TabBarController as my root view contro

11条回答
  •  时光说笑
    2021-02-04 03:48

    I ran into the same issue when adding a UITableView to my ViewController on viewDidLoad. Instead of grabbing the frame from self.view, I got it form the main window so that it looks like this

    UIWindow *keyWindow = [[[UIApplication sharedApplication] delegate] window];
    self.uiTable = [[UITableView alloc] initWithFrame:[keyWindow frame] style:UITableViewStylePlain];
    

提交回复
热议问题