Open smuskal opened 11 years ago
I have the same issue but even on iPhone. I think the padding at the top of the controller is really too high. Tried to find a way to change this but to no avail...
I ended up adding this ugly hack in viewDidLoad of QuickDialogController... Not sure this is generic enough or too specific but at least my app looks fine to me now!
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 &&
[self.view isKindOfClass:[QuickDialogTableView class]] &&
[self.root isKindOfClass:[QRadioElement class]] == FALSE) {
// calc vertical offset
int verticalOffset = -20;
// for not first controllers in tab bar
if (self.navigationController.navigationBar.translucent == TRUE) {
if ([self.parentViewController isKindOfClass:[UITabBarController class]]) {
UITabBarController* tabBarController = (UITabBarController*) self.parentViewController;
NSUInteger currentIndex = [tabBarController.viewControllers indexOfObject:self];
if (currentIndex > 0) {
verticalOffset += 64;
}
}
}
// remove more margin if 1st section has header
if (self.root.sections != nil && [self.root.sections count] > 0) {
QSection* section = [self.root.sections objectAtIndex:0];
if (section.headerView != nil) {
verticalOffset += -12;
}
}
// now do it
[(QuickDialogTableView*)self.view setContentInset:UIEdgeInsetsMake(verticalOffset, 0, 12, 0)];
}
Well I "FIXED :)" this with :
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) self.quickDialogTableView.contentInset = UIEdgeInsetsMake(-35, 0, 0, 0);
I've seen this happen when returning 0 from tableView:heightForHeaderInSection:
tableViewDelegate method. Not sure if that's the case here. I've fixed this in the past by returning 1 or 0.01 or some other small value.
Extra spacing is appearing in the header of quickdialog generated views.
See the difference is spacing from top to "Change Something" section header below.
QuickDialog.xcodeproj example under ios6:
under ios7: