Iphone 移动图像后显示登录视图-facebook登录,ios
鉴于: 目标 第一种方法 使用[UIView animateWithDuration:选项:动画:完成:]Iphone 移动图像后显示登录视图-facebook登录,ios,iphone,ios,objective-c,core-animation,grand-central-dispatch,Iphone,Ios,Objective C,Core Animation,Grand Central Dispatch,鉴于: 目标 第一种方法 使用[UIView animateWithDuration:选项:动画:完成:] 1. shift a logo upward 2. when shifting is done, the view will be shown 这个对我来说非常合适 然而,我仍然在下面说服第二种方法 第二种方法 首先向上移动标志,我正在做 [UIView animateWithDuration:.4 delay:0 options:UIViewAn
1. shift a logo upward
2. when shifting is done, the view will be shown
这个对我来说非常合适
然而,我仍然在下面说服第二种方法
第二种方法
首先向上移动标志,我正在做
[UIView animateWithDuration:.4 delay:0
options:UIViewAnimationOptionCurveLinear
animations:^{
CGRect newFrame = self.logo.frame;
newFrame.origin.y = 29;
self.logo.frame = newFrame;
}
completion:^(BOOL finished) {
self.viewA.alpha = 1;
}
];
第二,我能做到
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.duration=1;
theAnimation.autoreverses=NO;
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:-60];
theAnimation.removedOnCompletion = NO;
theAnimation.fillMode = kCAFillModeForwards;
[self.flipgiveLogo1.layer addAnimation:theAnimation forKey:@"animateLayer"];
显示视图。遗憾的是,这些操作没有按顺序执行
第一种方法不太可能是使用块来保证操作按顺序执行。
我确实试过使用下面这样的中央调度
self.viewA.alpha = 1;
这仍然困扰着我。
请帮忙,如果你知道我在GCD上做错了什么。欢迎所有评论在此区块工程?使用积木。街区很好。@danh:你能告诉我更多关于这个的情况吗。熟悉块,但不知道如何在这种情况下使用它。
self.viewA.alpha = 1;
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
// shifting logo goes here
dispatch_sync(dispatch_get_main_queue(), ^{
//displaying viewA goes here
});
});