我使用 CGAffineTransformMakeScale 将 UIView 从 0.1 缩放到 1.0。
问题是在缩放动画时视图也在旋转。所以它以 1.0 和 90° 旋转的比例结束。
[self presentModalViewController:slideTwoViewController animated: NO];
[slideTwoViewController.view setTransform:CGAffineTransformMakeScale(0.1,0.1)];
[UIView beginAnimations: nil context: nil];
[UIView setAnimationDuration:2.0];
[slideTwoViewController.view setTransform:CGAffineTransformMakeScale(1.0,1.0)];
[UIView commitAnimations];
最初的应用方向是横向左。因此,当动画结束时,UIView 看起来像纵向。
这应该发生吗?我错过了什么吗?
Thanks
我敢打赌,视图已经有一个变换集,并且您正在用新的变换覆盖它,并且它正在动画化差异。
尝试使用以下函数代替:
CGAffineTransformScale(<#CGAffineTransform t#>, <#CGFloat sx#>, <#CGFloat sy#>)
使用此函数,您可以传递原始变换slideTwoViewController.view.transform
和你的比例因子。
slideTwoViewController.view.transform = CGAffineTransformScale(slideTwoViewController.view.transform, 0.1, 0.1);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)