File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 43
43
// Core
44
44
#import " Three20Core/TTCorePreprocessorMacros.h"
45
45
46
+ static const CGFloat kEmptyHeaderHeight = 0 .f;
47
+ static const CGFloat kSectionHeaderHeight = 22 .f;
48
+ static const CGFloat kGroupedSectionHeaderHeight = 36 .f;
49
+ static const CGFloat kGroupedSectionFirstHeaderHeight = 36 .f + 10 .f;
50
+ static const NSUInteger kFirstTableSection = 0 ;
46
51
47
52
// /////////////////////////////////////////////////////////////////////////////////////////////////
48
53
// /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -115,6 +120,27 @@ - (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)
115
120
return nil ;
116
121
}
117
122
123
+ // /////////////////////////////////////////////////////////////////////////////////////////////////
124
+ - (CGFloat )tableView : (UITableView*)tableView heightForHeaderInSection : (NSInteger )section {
125
+ if ([tableView.dataSource respondsToSelector: @selector (tableView:titleForHeaderInSection: )]) {
126
+ NSString * title = [tableView.dataSource tableView: tableView titleForHeaderInSection: section];
127
+ if (![title length ]) {
128
+ return kEmptyHeaderHeight ;
129
+ }
130
+
131
+ if (tableView.style == UITableViewStylePlain) {
132
+ return kSectionHeaderHeight ;
133
+
134
+ } else {
135
+ if (section == kFirstTableSection ) {
136
+ return kGroupedSectionFirstHeaderHeight ;
137
+ }
138
+ return kGroupedSectionHeaderHeight ;
139
+ }
140
+
141
+ }
142
+ return kEmptyHeaderHeight ;
143
+ }
118
144
119
145
// /////////////////////////////////////////////////////////////////////////////////////////////////
120
146
/* *
You can’t perform that action at this time.
0 commit comments