我想知道表格查看项目的限制是什么,目前我使用大约120个元素,每个元素都有220x220x的照片,当我超过90-110左右时,表格视图在iPhone 5上变得有点滞后,我试图将照片调整为64x64但是,这仍然是滞后的,图像质量很糟糕。内存使用率低,大约50mb,但滚动tableview cpu使用率跃升30-90%。我有点担心,因为我要加载~800件......
CODE:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"cel_f";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
Cell* cellF;
if(self.isFiltered)
cellF = [self.filteredTableData objectAtIndex:indexPath.row];
else
cellF = [_tableData objectAtIndex:indexPath.row];
cell.textLabel.text = cellF.name;
cell.backgroundColor = [UIColor clearColor];
cell.imageView.image = [UIImage imageNamed:cellF.andThumbImage];
UILabel *myLabel = [[UILabel alloc] init];
myLabel.frame = CGRectMake(295, 11, 25, 21);
[myLabel setFont:[UIFont systemFontOfSize:17]];
myLabel.textColor = [UIColor blackColor];
myLabel.text = @">";
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor colorWithRed:240 green:248 blue:255 alpha:0.25];
[cell setSelectedBackgroundView:bgColorView];
[cell addSubview:myLabel];
return cell;
}