1
我有两个UIViews
(A和B)作为subviews
添加到UIViewcontroller
Main View
(超级视图)。如何正确动画旋转子视图的中心点
我想动画View A
(比例/旋转/移动中心点为View B
)。如果我进行缩放/旋转,动画很流畅。如果我只是做中心点,那么动画是平滑的。但是,当我试图包含更改中心点时,旋转和缩放View A
,然后View A
的中心点动画是即时和不平稳的,但旋转/缩放比较平滑。
这里是我的动画块:
[UIView animateWithDuration:2.0
animations:^ {
self.customView.frame = CGRectMake(self.containerSubview.frame.origin.x, self.containerSubview.frame.origin.y, 200, 300);
self.containerSubview.alpha = 0.2;
self.customView.transform = CGAffineTransformConcat(CGAffineTransformMakeRotation(M_PI/2), CGAffineTransformMakeScale(1.5, 1.5));
self.customView.center = self.containerSubview.center;
}
completion:^(BOOL finished) {
NSLog(@"center point: %@", NSStringFromCGPoint(self.customView.center));
}
];
我一直在努力解决完全相同的问题,我很想看到您的解决方案。您是否在该博客和示例中取得了进展?谢谢, – 2011-03-25 14:46:38
@wanderweird对于LATE回复抱歉。没有意识到有人评论过。是的......博客和示例位于:http://blog.corywiles.com/using-caanimationgroup-for-view-animations – 2011-07-08 17:44:32