Created
October 14, 2013 08:10
-
-
Save yoshimax/6972474 to your computer and use it in GitHub Desktop.
Inset for iOS7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)orientationChanged:(NSNotification *)notification { | |
| NSLog(@"%s", __func__); | |
| UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; | |
| CGRect statusBarViewRect = [[UIApplication sharedApplication] statusBarFrame]; | |
| float statusBarHeight = (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) ? statusBarViewRect.size.width : statusBarViewRect.size.height; | |
| float heightPadding = statusBarHeight + self.navigationController.navigationBar.frame.size.height; | |
| [self.tableView setContentInset:UIEdgeInsetsMake(heightPadding, self.tableView.contentInset.left, self.tableView.contentInset.bottom, self.tableView.contentInset.right)]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment