グループ化されたセル用に独自のセクションヘッダーを作成しようとしています。私はそれを作成すると、次のコードを使用して、境界がオフであるように見えます。具体的にはCGRect
iOS - カスタムセクションヘッダーの境界の問題
- (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;
}
の高さ、高さがオフになっている理由を任意のアイデア?何か不足していますか?あなたは、テーブルビューの種類(グループ化)を定義IBでセクションヘッダのプロパティを設定してから使用していない理由として興味があるだけ
正確に私が行方不明だったもの。あなたの親切な先生に感謝! – Romes