escoz/QuickDialog — Issue #32: QSection footer height is always 28.0 when it's set to a string
Author: karlozm
Created: 2011-12-08 19:15:44+00:00
State: open

**Problem**
When setting the section footer using a string its height is always 28 regardless of its length

**Proposed code solution**
I'm not pushing my copy of the code, i'm assuming you might want to use your own coding standards.

This code will calculate the height for the footer.

_QuickDialogTableDelegate.m (tableView:heightForFooterInSection:)_

```
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)index {
QSection *section = [_tableView.root getSectionForIndex:index];
CGFloat stringFooterHeight = 28.0;

if (section.footerView!=nil)
return section.footerView.frame.size.height;

if (section.footer != nil) {
CGFloat maxWidth = [UIScreen mainScreen].bounds.size.width - 50;
CGFloat maxHeight = 9999;
CGSize maximumLabelSize = CGSizeMake(maxWidth,maxHeight);
CGSize expectedLabelSize = [section.footer sizeWithFont:[UIFont systemFontOfSize:[UIFont labelFontSize]]
constrainedToSize:maximumLabelSize
lineBreakMode:UILineBreakModeWordWrap];

stringFooterHeight = expectedLabelSize.height;
}

return section.footer != NULL? stringFooterHeight : 0;
}
```