테이블에서 스크롤 속도가 느려지고 웹에서로드되고 크기가 조정 된 이미지가 스크롤러에 있지만 이미지가 이미로드되어 스크롤이 왜 느려지는지 이해할 수 없습니다. 내가 읽고 성공하지 slow scrolling of UITableView을 시도했다 (내가 빈 셀을 참조)테이블보기에서 느린 스크롤
이 셀 인을로드 셀에 코드가없는
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
NSString *[email protected]"";
NSString *icon;
NSMutableArray *result=[allResults objectAtIndex:indexPath.section];
NSDictionary *dic=[result objectAtIndex:indexPath.row+1];
if([[result objectAtIndex:0] isEqualToString:@"types"])
{
NSString *title=[dic objectForKey:@"title"];
icon=[dic objectForKey:@"icon"];
data=[data stringByAppendingString:[NSString stringWithFormat:@"%@",title]];
}
if([[result objectAtIndex:0] isEqualToString:@"subServices"])
{
NSString *title=[dic objectForKey:@"title"];
icon=[dic objectForKey:@"icon"];
data=[data stringByAppendingString:[NSString stringWithFormat:@"%@",title]];
}
if([[result objectAtIndex:0] isEqualToString:@"businesses"])
{
NSString *title=[dic objectForKey:@"title"];
icon=[dic objectForKey:@"logo"];
data=[data stringByAppendingString:[NSString stringWithFormat:@"%@",title]];
}
cell.textLabel.numberOfLines = 1;
cell.textLabel.text = data;
cell.textLabel.textColor=[UIColor blackColor];
cell.textLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:22];
cell.textLabel.textColor=[UIColor colorWithRed:122.0/255.0 green:181.0/255.0 blue:196.0/255.0 alpha:1];
cell.imageView.layer.masksToBounds = YES;
//load image
NSURL *url = [NSURL URLWithString:icon];
NSData *imdata = [NSData dataWithContentsOfURL:url];
UIImage *logo=[UIImage imageWithData:imdata scale:1];
UIImage *scaled=[self resizeImage:logo imageSize:CGSizeMake(30, 30)];
cell.imageView.image=scaled ;
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 12.0;
return cell;
}
'else/if' (세 개의'if' 테스트 연속체에 대해)를 사용해야합니다. 게으른 로딩 (URL 이미지 로딩)을 볼 수도 있습니다. – Larme