我是新的 iOS 开发人员。我想在 2 个视图控制器之间创建过渡动画
我能怎么做 ?
这是我的代码:
int newScreenDegrees = _screenDegrees - 90;
[UIView transitionWithView:self.containerView
duration:0.65f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
for(int i = 0; i < [self.screens count]; i++)
{
UIViewController *_screen = [self.screens objectAtIndex:i];
int curDeg = newScreenDegrees + i * SPACE_PER_SCREEN;
float curRad = convertDegreesToRadians(curDeg);
float newX = COORDINATES_CENTER_OF_CIRCLE_X + (CIRCLE_RADIUS * cos(curRad)) - (_screen.view.frame.size.width / 2) - 280;
float newY = COORDINATES_CENTER_OF_CIRCLE_Y + (CIRCLE_RADIUS * sin(curRad)) - (_screen.view.frame.size.height / 2);
// transform view
_screen.view.transform = transformMakeRotateTranslate(convertDegreesToRadians(curDeg + 90), newX, newY);
}
}
completion:^(BOOL finished){
_screenDegrees = newScreenDegrees;
// TODO: init content of current view and clear other views
}];
_screenDegrees = newScreenDegrees;
问题是:视图沿线而不是圆形移动。
谢谢
这是图片:http: //i.stack.imgur.com/xVQb3.jpg