извините, мой бедный английский, я могу вас неправильно понять.Но если не было ошибки: если вы не найдете «правильного» решения, вы можете попробовать это: (это не лучший способ сделать то, что вы хотите, но я могу предложить только один)
все, что вам нужно, это сделать ваш просмотр таблицы только с одним разделом, без заголовка.Затем просто сделайте каждый «сырой» заголовок другого раздела с разными параметрами:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return <number of all raws in all sections plus number of sections, to make some raws - sections>;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
for (int i = 0; i < (number of sections); i++) {
if (indexPath.raw == i*(number of raws in section i)) return (heigth of header);
}
return (heigth of raw);
}
//Configure cells:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
for (int i = 0; i < (number of sections); i++) if (indexPath.raw == i*(number of raws in section i)) {
//set properties to headers
return cell;
}
//set properties to raws
return cell;
}