以前はカスタムペン先を作成してセルを自由に作成していましたが、今回はセルの高さが変化するため、固定サイズのセルのペン先を作成できません。
それで私はそれをプログラムで作成することに決めました...それを達成するための良い方法の下の方法はありますか?
// Customize the appearance of table view 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];
UILabel *pseudoAndDate = [[UILabel alloc] initWithFrame:CGRectMake(0.0,0.0,320.0,20.0)];
[pseudoAndDate setTag:1];
[cell addSubview:pseudoAndDate];
[pseudoAndDate release];
}
CommentRecord *thisRecord = [comments objectAtIndex:[indexPath row]];
UILabel *label = (UILabel *)[cell viewWithTag:1];
[label setText:[NSString stringWithFormat:@"%@ | %@",thisRecord.author,thisRecord.date]];
return cell;
}
または..私はここで何かが欠けていますか?これまでのところ、うまくいかないようです;)
ありがとう、
ゴティエ。