私はイタリア語ですので、私の "醜い"英語には申し訳ありません!テーブルビューのヘッダーは2列に並んでいます
私はUITableviewで作業していますが、私の(動的な)ヘッダーが長すぎます! だから私は2つの行にヘッダーを分割したい...それは可能ですか?
私は "label.numberOfLines = 2"(または= 0)を使用しようとしましたが、動作しません。
これはコードです:
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UILabel *label = [[[UILabel alloc] init] autorelease];
label.backgroundColor = [UIColor clearColor];
NSString *header1 = [NSString stringWithFormat:@"Between %@ and %@ \n (33ª and 37ª week)", dateString1, dateString2];
if (section == 0){
label.text = header1;
label.frame = CGRectMake(0, 6, 300, 30);
} else
//the others header
label.numberOfLines = 2;
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 30)];
[view autorelease];
[view addSubview:label];
return view;}
はあなたに感謝します!
を、それは簡単でした!どうもありがとうございます!!! – JAA