Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIViewAnimationTransitionCurlUp水平工作_Ios_Uiview_Uiviewanimation_Uiviewanimationtransition - Fatal编程技术网

Ios UIViewAnimationTransitionCurlUp水平工作

Ios UIViewAnimationTransitionCurlUp水平工作,ios,uiview,uiviewanimation,uiviewanimationtransition,Ios,Uiview,Uiviewanimation,Uiviewanimationtransition,我尝试使UIViewAnimationTransitionCurlUp水平工作,以便旋转应用动画的视图。但是动画没有起作用,动画从下到上。有什么想法吗 first = [[PDFPortraitView alloc] initWithFrame:CGRectMake(0, 0, 960, 768) andCurrentPage:currentPage]; container = [[UIView alloc] initWithFrame:CGRectMake(-96, 140, 960,

我尝试使UIViewAnimationTransitionCurlUp水平工作,以便旋转应用动画的视图。但是动画没有起作用,动画从下到上。有什么想法吗

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];

尝试对视图的superview变换应用90度旋转。这将变换视图的坐标空间,因此应用于子视图的卷曲变换应在旋转坐标中卷曲

您可能必须创建多个视图以防止内容被旋转:

外部视图,旋转90度

中间视图-这是获取卷曲过渡的视图

   inner view, rotated -90 degrees, and containing your actual content.
我还没试过,但那应该行得通


请注意,切换到的视图必须是中间视图/内部视图组合。

尝试对视图的superview变换应用90度旋转。这将变换视图的坐标空间,因此应用于子视图的卷曲变换应在旋转坐标中卷曲

您可能必须创建多个视图以防止内容被旋转:

外部视图,旋转90度

中间视图-这是获取卷曲过渡的视图

   inner view, rotated -90 degrees, and containing your actual content.
我还没试过,但那应该行得通

请注意,切换到的视图必须是中间视图/内部视图组合