2014-02-28 4 views
1

UIView에 UITableView가 포함되어 있습니다. 셀을 선택하면 UIView Animation을 사용하여 TableView가 왼쪽으로 슬라이드되어 세부 사항을 표시 할 수 있습니다. 테이블 뷰를 원래 프레임으로 다시 슬라이드하면 테이블 뷰를 워퍼 뷰의 다른 요소 위로 스크롤 할 수 있습니다. 애니메이션 전에 테이블 뷰 셀 경계에서 테이블 뷰 셀을 위아래로 스크롤 할 수있었습니다. 왜 이런 일이 일어나는 걸까요?UIView 애니메이션이 TableView를 깨뜨림

- (void)slideTableView:(BOOL)reset 
{ 

    //Current pos 
    CGRect newTableViewFrame = self.tableView.frame; 

    //Determine direction based on current pos 
    int newX; 

    if (reset || newTableViewFrame.origin.x < 0) { 
     newX = newTableViewFrame.origin.x=0; 
    } 
    else { 
     newX = newTableViewFrame.origin.x - 280; 
    } 

    newTableViewFrame.origin.x =newX; 

    CGFloat animationDuration = 0.2; 
    CGFloat animationDelay = 0.0; 

    [UIView animateWithDuration:animationDuration delay:animationDelay options:UIViewAnimationOptionCurveEaseInOut 
       animations:^{ 

        self.tableView.frame=newTableViewFrame; 

       } 
       completion:^(BOOL finished){ 


       }]; 
} 
+0

나는 이전 뷰에 그림자를 추가하고 사용했다 : self.clipsToBounds = NO; self.layer.masksToBounds = NO; 위 설정을 다시 설정하기 만하면 : self.clipsToBounds = YES; self.layer.masksToBounds = YES; – Marty

답변

0

나는 이전 뷰에 그림자를 추가하고 사용했다 : 간단하게 위의 수정을 다시 설정

self.clipsToBounds = NO; 
self.layer.masksToBounds = NO; 

:

self.clipsToBounds = YES; 
self.layer.masksToBounds = YES; 
관련 문제