我在根视图中有一个简单的滚动视图。滚动视图大小占据屏幕的整个宽度/高度。
在我在滚动视图的 x 轴上执行 3d 旋转后,效果很好。屏幕底部有一些奇怪的工件。就像在根视图上克隆的滚动视图一样。
在此处附上屏幕:http: //imgur.com/WoMRFsx
注意屏幕底部附近的蓝色/紫色条纹。
有没有办法摆脱它?它们在制作动画时出现,因此动画后的简单屏幕刷新将不起作用。
更新代码:
CATransform3D transform = CATransform3DIdentity;
transform.m34 = 1.0f / -500.0f;
CATransform3D translation = CATransform3DTranslate(transform, 0.0, -20.0, 0.0);
CATransform3D finalTransform = CATransform3DRotate(translation, 45.0f, 1.0, 0.0, 0.0);
[viewImageScroll setClearsContextBeforeDrawing:YES];
[UIView animateWithDuration:3.0f delay:0.
options:(UIViewAnimationOptionCurveEaseInOut)
animations:^{
[viewImageScroll.layer setTransform:finalTransform];
} completion:^(BOOL finished) {
[viewImageScroll setClearsContextBeforeDrawing:YES];
CATransform3D transform = CATransform3DIdentity;
transform.m34 = 1.0f / -500.0f;
CATransform3D flyAway = CATransform3DTranslate(transform, 0., -7000., -10000.0);
flyAway = CATransform3DRotate(flyAway, 45.0f, 1.0, 0.0, 0.0);
[UIView animateWithDuration:2.0f delay:0.
options:(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionOverrideInheritedCurve)
animations:^{
NSLog(@"done");
[viewImageScroll.layer setTransform:flyAway];
[viewImageScroll setAlpha:0];
} completion:^(BOOL finished) {
NSLog(@"done and done");
[(X1NavigationController *)self.navigationController popControllerWithTransition:UIViewAnimationTransitionCurlDown];
}];
}];