1. <small id='WRNB1'></small><noframes id='WRNB1'>

      <bdo id='WRNB1'></bdo><ul id='WRNB1'></ul>
    <i id='WRNB1'><tr id='WRNB1'><dt id='WRNB1'><q id='WRNB1'><span id='WRNB1'><b id='WRNB1'><form id='WRNB1'><ins id='WRNB1'></ins><ul id='WRNB1'></ul><sub id='WRNB1'></sub></form><legend id='WRNB1'></legend><bdo id='WRNB1'><pre id='WRNB1'><center id='WRNB1'></center></pre></bdo></b><th id='WRNB1'></th></span></q></dt></tr></i><div id='WRNB1'><tfoot id='WRNB1'></tfoot><dl id='WRNB1'><fieldset id='WRNB1'></fieldset></dl></div>

    1. <tfoot id='WRNB1'></tfoot><legend id='WRNB1'><style id='WRNB1'><dir id='WRNB1'><q id='WRNB1'></q></dir></style></legend>

      如何像 iOS 7 iPad App Store 一样同时翻转和放大 UIView?

      时间:2023-06-11
    2. <legend id='P80i3'><style id='P80i3'><dir id='P80i3'><q id='P80i3'></q></dir></style></legend>
    3. <tfoot id='P80i3'></tfoot>

            <bdo id='P80i3'></bdo><ul id='P80i3'></ul>

            <i id='P80i3'><tr id='P80i3'><dt id='P80i3'><q id='P80i3'><span id='P80i3'><b id='P80i3'><form id='P80i3'><ins id='P80i3'></ins><ul id='P80i3'></ul><sub id='P80i3'></sub></form><legend id='P80i3'></legend><bdo id='P80i3'><pre id='P80i3'><center id='P80i3'></center></pre></bdo></b><th id='P80i3'></th></span></q></dt></tr></i><div id='P80i3'><tfoot id='P80i3'></tfoot><dl id='P80i3'><fieldset id='P80i3'></fieldset></dl></div>

                  <tbody id='P80i3'></tbody>
              1. <small id='P80i3'></small><noframes id='P80i3'>

                本文介绍了如何像 iOS 7 iPad App Store 一样同时翻转和放大 UIView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                iPad iOS 7 App Store 有一个非常酷的动画,当您单击应用程序图标时(当图标较小时,从精选列表中,而不是搜索结果).这是它的图片:

                The iPad iOS 7 App Store has a pretty cool animation for when you click on an app icon (from the featured list when the icon is smaller, not a search result). Here is a picture of it in action:

                基本上,图标会同时翻转和扩大.

                Basically, the icon flips and expands in size at the same time.

                后面有渐变,内容视图更小.

                There is a gradient behind it and the content view is smaller.

                到目前为止,我有一个自定义的 VC 过渡设置,并且我的放大部分工作正常,但我无法让翻转.如何模仿 App Store 动画?

                So far, I have a custom VC transition setup and I have the enlargement part working okay, but I can't get the flip to jive. How can I mimic the App store animation?

                这是我目前的代码:

                - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
                UIView *inView = [transitionContext containerView];
                UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
                UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
                UIView *fromView = [fromVC view];
                UIView *toView = [toVC view];
                toView.frame = [transitionContext finalFrameForViewController:toVC];
                
                // Take a snapshot of the new view being presented
                UIGraphicsBeginImageContextWithOptions(toView.bounds.size, NO, 0);
                CGContextRef ctx = UIGraphicsGetCurrentContext();
                [fromView.layer renderInContext:ctx];
                UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext();
                UIGraphicsEndImageContext();
                
                // Add the snapshot view and animate its appearance
                UIImageView *intermediateView = [[UIImageView alloc] initWithImage:snapshot];
                [inView addSubview:intermediateView];
                [self calculateSourceRectInView:inView];
                intermediateView.frame = self.sourceRect;
                
                [UIView animateWithDuration:[self transitionDuration:transitionContext] animations:^{
                    intermediateView.layer.transform = CATransform3DMakeRotation(-1.0 * -M_PI_2, 0.0, 1.0, 0.0);
                    intermediateView.frame = toView.frame;
                } completion:^(BOOL finished) {
                    [intermediateView removeFromSuperview];
                
                    if ([transitionContext transitionWasCancelled]) {
                        [transitionContext completeTransition:NO];
                    } else {
                        [inView addSubview:toView];
                        [fromView removeFromSuperview];
                        [transitionContext completeTransition:YES];
                
                        // Now this is a pushed view, we allow interactive
                        // transitioning back to the parent view.
                        self.interactiveTransition = [EBInteractiveZoomTransition new];
                        [self.interactiveTransition wireToViewController:toVC];
                    }
                }];
                }
                

                推荐答案

                试试这个方法...

                //set Intial Frame of view
                
                [UIView transitionWithView: self.view
                                  duration: 1.5f
                                   options: UIViewAnimationOptionTransitionFlipFromRight
                                animations: ^(void)
                 {
                 }
                                completion: ^(BOOL isFinished)
                 {
                      // set the Final Frame of the View
                 }];
                

                这篇关于如何像 iOS 7 iPad App Store 一样同时翻转和放大 UIView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:UINavigationController 上未出现后退按钮 下一篇:iphone:在导航时强制将方向从纵向更改为横向

                相关文章

              2. <legend id='Vb324'><style id='Vb324'><dir id='Vb324'><q id='Vb324'></q></dir></style></legend>

                <small id='Vb324'></small><noframes id='Vb324'>

                  • <bdo id='Vb324'></bdo><ul id='Vb324'></ul>

                  1. <tfoot id='Vb324'></tfoot>
                    <i id='Vb324'><tr id='Vb324'><dt id='Vb324'><q id='Vb324'><span id='Vb324'><b id='Vb324'><form id='Vb324'><ins id='Vb324'></ins><ul id='Vb324'></ul><sub id='Vb324'></sub></form><legend id='Vb324'></legend><bdo id='Vb324'><pre id='Vb324'><center id='Vb324'></center></pre></bdo></b><th id='Vb324'></th></span></q></dt></tr></i><div id='Vb324'><tfoot id='Vb324'></tfoot><dl id='Vb324'><fieldset id='Vb324'></fieldset></dl></div>