iPhone 向左 curl 和向右 curl 过渡

标签 iphone curl uiview transition cgaffinetransform

我正在寻找一种在 iPhone 上进行 UIViewAnimationTransitionCurlUpUIViewAnimationTransitionCurlDown 转换的方法,但不是从上到下,而是从左到右(或从上到下)/底部横向模式)。我在互联网上多次看到这个问题,但似乎没有人得到答案。不过我觉得这是可行的。

我尝试更改 View 的变换和 view.layer 的变换,但这并没有影响转换。由于当设备改变方向时过渡会发生变化,我认为有一种方法可以欺骗设备在纵向模式下使用横向过渡,反之亦然?

最佳答案

使用容器 View 可以在四个方向中的任何一个方向上进行 curl 。将容器 View 的转换设置为您想要的角度,然后通过将您的 View 添加到容器 View (而不是没有转换框架的应用程序主视图)来进行 curl :

NSView* parent = viewController.view; // the main view
NSView* containerView = [[[UIView alloc] initWithFrame:parent.bounds] autorelease];
containerView.transform = CGAffineTransformMakeRotation(<your angle here, should probably be M_PI_2 * some integer>);
[parent addSubview:containerView]; 

[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:containerView cache:YES];
[containerView addSubview:view];
[UIView commitAnimations];

关于iPhone 向左 curl 和向右 curl 过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1625375/

相关文章:

php - DOMDocument::save[domdocument.save]:无法打开流:权限被拒绝

ios - 在 UITabbarController 中为所有 View Controller 添加一个公共(public) View

iphone - 是否存在适用于 iOS 的 NSPredicateEditor 之类的东西?

iphone - 西类牙语版 iPhone 应用程序,需要 Windows 软件才能运行

iPhone Core 数据驱动搜索 : How To, 资源?

python - 无法以正确的格式将数据提取到 Pandas 数据框中

ios - 从桥接 header 到 Swift 项目的 Obj-C 类调用 Swift 类

java - spring data findById() 适用于curl,但不适用于浏览器

ios - "Stack"UIViewController 中的 UIViews (iOS 7)

ios - 以灰度渲染下面的所有 UIView