私は現在自分のカスタムセクションヘッダーを作成していますが、コードを使用してテキストを編集することはありません。カスタムヘッダーを作成するために使用している新しいメソッドは、示さ私は白にテキストを変更し、少し大胆なこととも白の背景を透明にしたいセクションヘッダーをカスタマイズするuilabel背景とテキスト
の下..
これは私がこの
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];
[headerView setBackgroundColor:[UIColor grayColor]];
// Add the label
UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.5, 20, 20)];
// do whatever headerLabel configuration you want here
headerLabel.text = [self tableView:tableView titleForHeaderInSection:section];
[headerView addSubview:headerLabel];
// Return the headerView
return headerView;
}
を行うために使用していたコードです私はtを試した彼の
[headerLabel.backgroundColor:[UIColor clearColor]];
などが、そのは:(
'headerLabel.backgroundColor = [UICに入れますolor clearColor]; 'もうまくいくはずです;) – Costique
@Costique、mon dieu!何もゲッターを設定していません。 – CodaFi
@CodaFi +1あなたが面白いので、答えを与えることでポイントブランク – Charan