How do I make my iOS7 UITableViewController NOT appear under the top status bar?

前端 未结 13 2093
旧巷少年郎
旧巷少年郎 2020-12-13 14:04

My root controller is a TabBarController (tabbed application). One of the tabs, is a UITableViewController. When I switch to that and scroll through the items, they show up

13条回答
  •  清歌不尽
    2020-12-13 14:30

    Try this in viewDidLoad:

    self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
    

    20 px being the height of the status bar. If you have a navigation bar use 64 instead of 20

提交回复
热议问题