我有三個不同的自定義cells.Each表視圖會從三個不同的細胞classes.`加載Tableview滾動並不那麼流暢?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier1 = @"CellIdentifier";
static NSString *CellIdentifier2 = @"Cell";
static NSString *CellIdentifier3 = @"Cell";
if (indexPath.section == 0)
{
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell == nil)
{
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier1] autorelease];
}
[email protected]"dhhg";
[email protected]"shdhsjdj";
[email protected]"sdhhhfhjhfj";
cell.myImageView.image=[UIImage imageNamed:@"sd.png"];
[email protected]"hhhf";
return cell;
}
else
{
Customcellwithimage *cell = (Customcellwithimage *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
if (cell == nil)
{
cell = [[[Customcellwithimage alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier2] autorelease];
}
[email protected]"sdhkhks";
[email protected]"sdhjkhkshd";
[email protected]"sdsdsd";
cell.myImageView1.image=[UIImage imageNamed:@"shdjhjhs"];
[email protected]"sjdh";
cell.bannerview1.image=[UIImage imageNamed:@"dshjs"];
return cell;
}
return Nil;
}
'。這是我對design.Can任何代碼幫助我在我要去的地方錯誤?
當取消註釋圖像的東西時,甚至會發生這種情況嗎? –
它從我的自定義類中加載。單元格本身包含一個圖像。 –
是的,所以當你取消處理圖像的所有代碼時,請檢查它是否仍然有問題,以便最終不加載圖像。基本上,這應該工作,你有證據表明你的圖像造成滯後。 –