【问题标题】:Transition segue like facebook open image to fullscreen xcode将 facebook 打开图像之类的 segue 转换为全屏 xcode
【发布时间】:2013-12-19 08:21:58
【问题描述】:

谁能说当我将图像打开到全屏时如何在 facebook 应用程序中实现过渡转场?

我找到了这个例子http://joris.kluivers.nl/blog/2013/01/15/custom-view-controller-transitions-using-uistoryboardsegues/

但它在 ios7 上的过渡期间闪烁,我不明白如何修复它(有任何想法吗?

【问题讨论】:

    标签: xcode facebook transition segue


    【解决方案1】:

    闪烁是由创建的临时图像引起的,该图像是为了模拟在图像在新视图中取消隐藏之前被移除的过渡。我将完成块更改为延迟 0.25 秒以使图像不被隐藏。

    [UIView animateWithDuration:0.4f delay:.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{
        imageView.frame = dest;
    
        if (self.unwinding) {
            [self.destinationViewController dismissViewControllerAnimated:YES completion:nil];
        } else {
            ((UIViewController *)self.destinationViewController).modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
            [self.sourceViewController presentViewController:self.destinationViewController animated:YES completion:nil];
        }
    } completion:^(BOOL completed) {
        int64_t delayInSeconds = 1;
    
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC/4);
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
            imageView.hidden = YES;
            [imageView removeFromSuperview];
        });
    }];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多