// Workaround for iOS7 UINavigationController layout issue.
// In iOS7, navigation bar is overlapping with the displayed view.
// Needs to shift it down by navigation bar height and shrink its height.
// But do not do this for table view.
- (void)navigationController:(UINavigationController *)navigationController
didShowViewController:(UIViewController *)vc
animated:(BOOL)animated {
if(!IOS7_OR_UP)
return;
if ([vc.view isKindOfClass:NSClassFromString(@"UITableView")])
return;
static int barH = 0;
if (barH == 0) {
UIView* bar = findViewOfClass(vc.view.superview.superview.superview, NSClassFromString(@"UINavigationBar"));
barH = bar.frame.size.height;
}
CGRect frame = vc.view.frame;
frame.size.height -= barH;
frame.origin.y = barH;
vc.view.frame = frame;
}
No comments:
Post a Comment