このコードを使用して、セル内に画像を作成します。
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"CellIdentifier"] autorelease];
switch (indexPath.row) {
...
case 5:
cell.imageView.image = [UIImage imageNamed:@"Search.png"];
break;
default:
break;
}
return cell;
}
画像をセルの中央に配置するにはどうすればよいですか? UITableViewCell をサブクラス化する必要がありますか?