Interface BuilderのUITableViewにいくつかの異なるカスタムセルを作成しました。それぞれのセルの高さは、デフォルトの44ピクセルよりも大きいカスタムの高さです。
次に、次のようにロードします。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier;
for (int cell = 0; cell <= [tableCellsArray count]; cell++)
{
if ([indexPath row] == cell)
{
CellIdentifier = [tableCellsArray objectAtIndex:cell];
}
}
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
return cell;
}
それぞれにカスタムクラスがあり、上記のコードでは、基本的に関連するセル識別子を保持する配列をループします。ただし、アプリを実行すると、すべてのセルがデフォルトの44ピクセルの高さを返します。
デリゲートメソッドを使用して自分のセルの高さを返すことなく、これを引き起こす可能性のある見逃したものはありませんか?
ありがとう。