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

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

    <tfoot id='Ifzo2'></tfoot>

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

        如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK)

        How to capture current view screenshot and reuse in code? (iPhone SDK)(如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK))
      2. <small id='dO57J'></small><noframes id='dO57J'>

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

      3. <legend id='dO57J'><style id='dO57J'><dir id='dO57J'><q id='dO57J'></q></dir></style></legend>
          • <bdo id='dO57J'></bdo><ul id='dO57J'></ul>
              <tbody id='dO57J'></tbody>

                  <tfoot id='dO57J'></tfoot>
                  本文介绍了如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  当用户旋转设备时,我正在尝试从一个 UIView 转换到另一个.这本身并不难.但是,由于我在旋转后显示的是完全不同的内容,所以 UIKit 提供的默认动画(旋转当前显示的视图)在概念上是不合适的.

                  I am attemting to transition from one UIView to another, when the user rotates the device. This, in of itself, is not difficult. However, since I am displaying completely different content after the rotation, the default animation provided by UIKit (rotating the currently displayed view) is inappropriate conceptually.

                  简单地禁用动画并突然交换视图是可以容忍的,但远低于我正在构建到应用程序其余部分的润色.我更愿意这样做:

                  Simply disabling the animation and swapping the views suddenly is tolerable, but is far below the polish I'm building into the rest of the app. What I would prefer to do is this:

                  当调用 shouldAutorotateToInterfaceOrientation: 时,我想获取旋转前用户视图的不透明视图快照,如果你愿意,可以截屏.然后在旋转完成并且系统应用了视图变换等之后,我可以显示我保存的快照视图并将我选择的动画转换为我的新视图.完成后,我可以释放我的快照并继续前进.

                  When shouldAutorotateToInterfaceOrientation: is called, I would like to grab an opaque view snapshot, a screenshot if you will, of the user view before rotation. Then after the rotation is completed and the system has applied the view transforms etc, I can show the snapshot view I saved and animate a transition of my choice to my new view. After it is completed, I can release my snapshot and move on.

                  有没有不花钱的方法?

                  我能想到的唯一其他选择是在除默认方向之外的所有方向上都返回 NO,然后通过应用我自己的动画和变换来做出反应.但是,我更喜欢使用系统来执行此操作,因为我觉得自己执行此操作可能会导致手动旋转视图中的未定义"键盘行为等.

                  The only other option I can think of is to return NO on all orientations other than my default one, and then react by applying my own animations and transforms. I'd prefer to use the system to do this however, as I feel it is likely doing it myself could cause "undefined" keyboard behavior in the manually rotated view, etc.

                  想法?

                  推荐答案

                  我可以保证 [window drawRect:] 不会工作.大多数视图没有实现 drawRect: 并且它肯定不像在 mac 上那样递归.

                  I can guarantee you [window drawRect:] won't work. Most views don't implement drawRect: and it's certainly not recursive like on the mac.

                  drawInContext: 也非常相似,因为它从根本上要求图层绘制自己,而不是递归地绘制它的子图层.默认实现什么都不做."说明一切.

                  drawInContext: is also pretty much hosed simalarly, as it's fundamentally asking the layer to draw itself, not its sublayers recursively. "Default implementation does nothing." says it all.

                  我通过执行以下操作在应用商店中为 Clif Bar Save Our Snow 应用实现此功能:

                  I implementing this for the Clif Bar Save Our Snow app in the app store by doing the following:

                  • 递归遍历层级,从每一层获取内容.如果它闻起来像图像,请使用 CGContext 方法将其绘制到您的上下文中.
                  • 在行走时,请确保在递归调用时应用每一层的变换/位置

                  是的,相当大的痛苦.但是,是的,它运行得很好,并且被 Apple 解决了 :).

                  Yes, a rather large pain in the ass. But yes, it works pretty well and got through by Apple :).

                  这篇关于如何捕获当前视图屏幕截图并在代码中重用?(iPhone SDK)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How To Create a Rotating Wheel Control?(如何创建转轮控件?)
                  iOS 6 rotations: supportedInterfaceOrientations doesn#180;t work?(iOS 6 旋转:supportedInterfaceOrientations 不起作用?)
                  CABasicAnimation rotate returns to original position(CABasicAnimation 旋转返回原始位置)
                  How to avoid restarting activity when orientation changes on Android(如何在 Android 上的方向更改时避免重新启动活动)
                  UITabBarController Rotation Issues in ios 6(ios 6 中的 UITabBarController 旋转问题)
                  iOS: How to run a function after Device has Rotated (Swift)(iOS:设备旋转后如何运行函数(Swift))
                  <i id='wZ4iG'><tr id='wZ4iG'><dt id='wZ4iG'><q id='wZ4iG'><span id='wZ4iG'><b id='wZ4iG'><form id='wZ4iG'><ins id='wZ4iG'></ins><ul id='wZ4iG'></ul><sub id='wZ4iG'></sub></form><legend id='wZ4iG'></legend><bdo id='wZ4iG'><pre id='wZ4iG'><center id='wZ4iG'></center></pre></bdo></b><th id='wZ4iG'></th></span></q></dt></tr></i><div id='wZ4iG'><tfoot id='wZ4iG'></tfoot><dl id='wZ4iG'><fieldset id='wZ4iG'></fieldset></dl></div>

                  <tfoot id='wZ4iG'></tfoot>
                    <legend id='wZ4iG'><style id='wZ4iG'><dir id='wZ4iG'><q id='wZ4iG'></q></dir></style></legend>
                      <bdo id='wZ4iG'></bdo><ul id='wZ4iG'></ul>

                            <tbody id='wZ4iG'></tbody>

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