我在根视图中有一个简单的scrollview。滚动视图大小占据屏幕的整个宽度/高度。
我在scrollview的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];
}];
}];