0
나는 UITableView
에 JSON의 이름 및 이미지 목록을 제공합니다. "SDWebImage"는 이미지 다운로드를 처리합니다. 사용자가 행을 선택하거나 테이블 뷰를 스크롤 할 때 이미지가 왼쪽으로 이동한다는 점을 제외하고는 정상적으로 작동합니다.셀 선택 또는 스크롤 할 때 UITableView에서 UIImage 이동
두 가지 화면 캡처로 문제를 표시합니다.
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];
}
cell.textLabel.text = [[array objectAtIndex:indexPath.row]objectForKey:@"marca"];
cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
[cell.imageView setImageWithURL:[NSURL URLWithString:[[array objectAtIndex:indexPath.row]objectForKey:@"photoUrl"]]placeholderImage:[UIImage imageNamed:@"placeholder.png"] ];
return cell;
}
내가 할 수있는 움직이는 이미지를 중지 :
인터페이스 빌더 설치
구현 꽤 표준이다?
맞춤 이미지 뷰 사용 –