Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Stanley Gao3,889 Points
View keeps extending full screen and stacking over status bar. How can I fix it?
I created a Table View Controller and it blocks the status bar. I can't find a way to resize the table view. I have googled this problem and the answers are not helpful.
I tried to check all three boxes under Attribute Inspector -> View Controller -> Extend Edges "Under Top Bars, Under Bottom Bars, and Under Opaque Bars". It didn't have any effect.
I also tried to do it programmatically in viewDidLoad function using:
```Objective C self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
This did move the section bars below the status bar. However, when I swipe down, the rows are still showing up in status bar.
I have been stuck here for days, can anyone show me how to fix it please.
Stone Preston42,016 Points
below is a quick and easy fix.
you can add an empty tableHeaderView to your table that is the same height as the status bar and it will push it down below the status bar:
place the following code in viewDidLoad:
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 20)];
self.tableView.tableHeaderView = headerView;