mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-01-12 22:51:51 +08:00
Ability to set custom header / footer height
This commit is contained in:
@@ -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:)])
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
if (!self)
|
||||
return nil;
|
||||
|
||||
self.mutableItems = [[NSMutableArray alloc] init];
|
||||
_mutableItems = [[NSMutableArray alloc] init];
|
||||
_headerHeight = RETableViewSectionHeaderHeightAutomatic;
|
||||
_footerHeight = RETableViewSectionFooterHeightAutomatic;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user