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

iOS

Brayden Kness
Brayden Kness
12,492 Points

The Status Bar Is In The Way

In the blog reader app the status bar covers up part of the top cell and when I scroll it covers other cells it is transparent so you can see the text from both the tableViewCell and the status bar show on top of each other and it doesn't look well is there any thing I can do

2 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

You can add a table header view which will create some space between the top edge of the screen and the table view.

Add the following code to your viewDidLoad method:

self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 30)];
Brayden Kness
Brayden Kness
12,492 Points

Thanks a lot that really helped one more question is there anyway to make the status bar opaque?

Amit, with this code, when you scroll up on the blog, the text still still appears under the translucent status bar. Is there a way to fix this so the scrolled text disappears under the status bar? Thanks!

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

That problem will be fixed in the final stage when you embed a navigation controller.