- Updating visible section header frame computation

- Adding sections to the example project
This commit is contained in:
Brian William Wolter
2011-07-07 18:24:01 -04:00
parent 023f33e4d4
commit 4b6550479d
5 changed files with 87 additions and 9 deletions
+16 -1
View File
@@ -16,6 +16,7 @@
#import "ExampleView.h"
#import "ExampleTableViewCell.h"
#import "ExampleSectionHeaderView.h"
#define TAB_HEIGHT 60
@@ -116,9 +117,14 @@
NSLog(@"selected tab %ld", index);
}
- (NSInteger)numberOfSectionsInTableView:(TUITableView *)tableView
{
return 8;
}
- (NSInteger)tableView:(TUITableView *)table numberOfRowsInSection:(NSInteger)section
{
return 200;
return 25;
}
- (CGFloat)tableView:(TUITableView *)tableView heightForRowAtIndexPath:(TUIFastIndexPath *)indexPath
@@ -126,6 +132,15 @@
return 50.0;
}
-(TUIView *)tableView:(TUITableView *)tableView headerViewForSection:(NSInteger)section {
ExampleSectionHeaderView *view = [[ExampleSectionHeaderView alloc] initWithFrame:CGRectMake(0, 0, 100, 32)];
TUIAttributedString *title = [TUIAttributedString stringWithString:[NSString stringWithFormat:@"Example Section %d", section]];
title.color = [TUIColor blackColor];
title.font = exampleFont2;
view.labelRenderer.attributedString = title;
return [view autorelease];
}
- (TUITableViewCell *)tableView:(TUITableView *)tableView cellForRowAtIndexPath:(TUIFastIndexPath *)indexPath
{
ExampleTableViewCell *cell = reusableTableCellOfClass(tableView, ExampleTableViewCell);