gpt4 book ai didi

ios - UIViewAnimationTransitionCurlUp 水平工作

转载 作者:行者123 更新时间:2023-12-01 17:00:38 25 4
gpt4 key购买 nike

我尝试使 UIViewAnimationTransitionCurlUp 水平工作,因此我旋转了应用动画的 View 。但是没有用,动画从底部一直停留在顶部。任何的想法?

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

最佳答案

尝试将 90 度旋转应用于 View 的 super View 的变换。这应该会改变 View 的坐标空间,因此应用于 subview 的 curl 过渡应该在旋转坐标中 curl 。

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

外 View ,旋转 90 度。

中间 View - 这是获得 curl 过渡的 View

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

我没有尝试过,但这应该可以。

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

关于ios - UIViewAnimationTransitionCurlUp 水平工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7202173/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com