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 Build a Blog Reader iPhone App Rebuilding from Scratch Model-View-Controller

Richard Lu
Richard Lu
20,185 Points

TableViewCell position is off

Hi, could someone guide to the right direction for fixing the position on my TableViewCell. Currently it looks like this:

http://s1084.photobucket.com/user/Rluftw/media/ScreenShot2014-04-30at93830PM.png.html

1 Answer

Stone Preston
Stone Preston
42,016 Points

That happens because in iOS 7 the status bar is transparent and views no longer float under it, they will appear beneath it. you can fix it by adding a tableHeader to your tableView to fill in some space

UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size,width, 20)];
self.tableView.tableHeaderView = headerView;
Richard Lu
Richard Lu
20,185 Points

Thanks, you're very very very helpful! I appreciate it! :D

Stone Preston
Stone Preston
42,016 Points

haha thanks I try to be. another option is to adjust the insets, but the header works just as well

self.tableView.contentInset = UIEdgeInsetsMake(20.0f, 0.0f, 0.0f, 0.0f);