diff --git a/RETableViewManager/RETableViewManager.m b/RETableViewManager/RETableViewManager.m index 0ce3c09..973eaf2 100755 --- a/RETableViewManager/RETableViewManager.m +++ b/RETableViewManager/RETableViewManager.m @@ -401,6 +401,10 @@ else if (section.headerTitle.length) return self.defaultTableViewSectionHeight; + if (section.headerHeight != RETableViewSectionFooterHeightAutomatic) { + return section.headerHeight; + } + // Forward to UITableView delegate // if ([self.delegate conformsToProtocol:@protocol(UITableViewDelegate)] && [self.delegate respondsToSelector:@selector(tableView:heightForHeaderInSection:)]) @@ -417,6 +421,10 @@ else if (section.footerTitle.length) return self.defaultTableViewSectionHeight; + if (section.footerHeight != RETableViewSectionFooterHeightAutomatic) { + return section.footerHeight; + } + // Forward to UITableView delegate // if ([self.delegate conformsToProtocol:@protocol(UITableViewDelegate)] && [self.delegate respondsToSelector:@selector(tableView:heightForFooterInSection:)]) diff --git a/RETableViewManager/RETableViewSection.h b/RETableViewManager/RETableViewSection.h index 5702df0..f894b44 100644 --- a/RETableViewManager/RETableViewSection.h +++ b/RETableViewManager/RETableViewSection.h @@ -28,6 +28,9 @@ @class RETableViewManager; @class RETableViewCellStyle; +static CGFloat const RETableViewSectionHeaderHeightAutomatic = DBL_MAX; +static CGFloat const RETableViewSectionFooterHeightAutomatic = DBL_MAX; + /** Table view section. */ @@ -48,6 +51,16 @@ */ @property (copy, readwrite, nonatomic) NSString *footerTitle; +/** + The height of the header of the specified section of the table view. + */ +@property (assign, readwrite, nonatomic) CGFloat headerHeight; + +/** + The height of the footer of the specified section of the table view. + */ +@property (assign, readwrite, nonatomic) CGFloat footerHeight; + /** A view object to display in the header of the specified section of the table view. */ diff --git a/RETableViewManager/RETableViewSection.m b/RETableViewManager/RETableViewSection.m index b7403e3..b870089 100644 --- a/RETableViewManager/RETableViewSection.m +++ b/RETableViewManager/RETableViewSection.m @@ -69,7 +69,9 @@ if (!self) return nil; - self.mutableItems = [[NSMutableArray alloc] init]; + _mutableItems = [[NSMutableArray alloc] init]; + _headerHeight = RETableViewSectionHeaderHeightAutomatic; + _footerHeight = RETableViewSectionFooterHeightAutomatic; return self; }