2011-08-26 2 views
2

UIViewAnimationTransitionCurlUp을 가로로 만들려고하므로 애니메이션이 적용된 뷰를 회전시킵니다. 그러나 작동하지 않습니다. 애니메이션은 하단에서 상단으로 유지됩니다. 어떤 생각?UIViewAnimationTransitionCurlUp horizontally working

first = [[PDFPortraitView alloc] initWithFrame:CGRectMake(0, 0, 960, 768) andCurrentPage:currentPage]; 
    container = [[UIView alloc] initWithFrame:CGRectMake(-96, 140, 960, 768)]; 
    container.backgroundColor = [UIColor redColor]; 
    container.transform = CGAffineTransformMakeRotation(M_PI * (0.5)); 
    [self.view addSubview:container]; 
    [container addSubview:first]; 


    second = [[PDFPortraitView alloc] initWithFrame:CGRectMake(0, 0, 960, 768) andCurrentPage:currentPage]; 


    [UIView beginAnimations:nil context:nil]; 
    [UIView setAnimationDuration:1.5f]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:container cache:NO]; 
    [first removeFromSuperview]; 
    [container addSubview:second]; 
    [UIView commitAnimations]; 

답변

0

보기의 수퍼 뷰의 변환에 90도 회전을 적용 해보십시오. 이렇게하면 뷰의 좌표 공간이 변형되므로 자식 뷰에 적용된 컬 전이가 회전 된 좌표에서 말려 있어야합니다.

당신은 회전에서 콘텐츠를 유지하기 위해 여러 뷰를 생성 할 수 있습니다

외부보기

는 90도 회전.

중간보기 -이는 컬 전환에게 나는 그것을 시도하지 않은

inner view, rotated -90 degrees, and containing your actual content. 

을 얻는이다,하지만 작동합니다.

전환 한보기는 중간보기/내부보기 조합이어야합니다.