グループ化されたセルに独自のセクション ヘッダーを作成しようとしています。次のコードを使用して作成すると、境界が外れているように見えます。より具体的には、CGRect
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *header = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 50)] autorelease];
[header setBackgroundColor:[UIColor clearColor]];
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(10, 3, tableView.bounds.size.width, 18)] autorelease];
label.textColor = [UIColor redColor];
label.text = @"SOME TEXT";
label.backgroundColor = [UIColor clearColor];
[header addSubview:label];
return header;
}
高さがずれている理由は何か分かりますか?何か不足していますか?