Skip to content

Instantly share code, notes, and snippets.

@Shosta
Created September 18, 2013 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shosta/6608899 to your computer and use it in GitHub Desktop.
Save Shosta/6608899 to your computer and use it in GitHub Desktop.
Code to add on viewDidLoad to handle the new Window and View management from iOS6 to iOS7 for your TableView.
#pragma mark - View
#define STATUS_BAR_HEIGHT [UIApplication sharedApplication].statusBarFrame.size.height
#define NAVIGATION_BAR_HEIGHT self.navigationController.navigationBar.bounds.size.height
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.edgesForExtendedLayout = UIRectEdgeTop;
[self.yourTableView setContentInset:UIEdgeInsetsMake(STATUS_BAR_HEIGHT + NAVIGATION_BAR_HEIGHT, 0, 0, 0)];
[self.yourTableView setScrollIndicatorInsets:UIEdgeInsetsMake(STATUS_BAR_HEIGHT + NAVIGATION_BAR_HEIGHT, 0, 0, 0)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment