2012-11-09 3 views
0

도와주세요. UITableViewCell 내부에서 작업하는 프레임 위치의 애니메이션을 얻으려고 시도하는 중, 특히 기본 UILabel (cell.textLabel)을 이동하려고합니다. 그러나, 내가 사용하는 기술에 상관없이, 셀 안의 어떤 뷰도 움직일 수 없습니다. 색상 및 알파의 애니메이션은 아래 코드에 설명 된대로 작동합니다.UITableViewCell의 UILabel의 프레임 (및 다른 뷰의 프레임) 애니메이션

미리 도움을 요청하십시오. 나는 그것이 표준 셀의 기본 레이블 또는 이미지보기 위치를 변경하는 것이 가능하다 생각하지 않는다

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    if (indexPath.section == 0 && indexPath.row == 0) { 

     UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 

     CGRect textLabelFrame = cell.textLabel.frame; 
     textLabelFrame.origin.x = -textLabelFrame.size.width; 

     [UIView animateWithDuration:0.5 
      delay:0.0 
      options:UIViewAnimationCurveEaseOut 
      animations:^{ 
       cell.textLabel.frame = textLabelFrame; // THIS DOESN'T WORK - HELP! 
       cell.imageView.frame = CGRectOffset(cell.imageView.frame,0,0); // EVEN TRYING TO MOVE IMAGEVIEW DOESN'T WORK 
       cell.textLabel.alpha = 0; // This animates 
       cell.imageView.backgroundColor = [UIColor redColor]; // This animates 
      } 
      completion:^(BOOL finished){ 
       NSLog(@"Done!"); 
     }]; 
    } 
} 
+0

맞춤형 uitableview 셀을 만들어 사용하십시오. –

답변

0

: 여기 앤디

내가 사용하고있는 코드입니다. 그렇게하고 싶다면 셀의 contentView에 자신의 하위 뷰를 추가하고 애니메이션을 사용하여 애니메이션을 작성해야합니다.

관련 문제