![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 悠良悠良 ![]()
![]() |
以下是我程式碼 static NSString *CellIdentifier = @"fateServiceCell"; //dequeueReusableCellWithIdentifie 獲取以前創建的cell被標記為重複利用的對象 tableViewCell *cell = (tableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { //雙數顯示 if (indexPath.row%2 == 0) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"tableViewCell" owner:self options:nil]; cell = [topLevelObjects objectAtIndex:0]; cell.celltext.text = [listData objectAtIndex:indexPath.row/2+1]; NSString *image = [listData2 objectAtIndex:indexPath.row/2+1]; cell.image1.image = [UIImage imageNamed:image]; } else { //單數隱藏 NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"tableViewCell" owner:self options:nil]; cell = [topLevelObjects objectAtIndex:0]; // 應該只要改這裡吧??? 我不知道要怎麼做他才能不讓他顯示 } }
搜尋相關Tags的文章:
[ UITableViewCell 自定Cell ] ,
本篇文章發表於2012-02-29 17:50 |