2014-05-21 2 views
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; 
} 

내가 할 수있는 움직이는 이미지를 중지 :

Initial aspect

After selection

인터페이스 빌더 설치 IB

구현 꽤 표준이다?

+0

맞춤 이미지 뷰 사용 –

답변

1

방금 ​​앱에서 비슷한 문제가 발생하여 UITableViewCells 기본 imageView IBOutlet을 다시 사용했기 때문에 발견되었습니다.

imageView 이외의 다른 IBOutlet을 만든 다음 연결하여 문제를 해결했습니다.

관련 문제