• <small id='We7nK'></small><noframes id='We7nK'>

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

    1. <tfoot id='We7nK'></tfoot>

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

        将旋转转换设置为 UIView 或其图层似乎不起作用?

        Setting a rotation transformation to a UIView or its layer doesn#39;t seem to work?(将旋转转换设置为 UIView 或其图层似乎不起作用?)

        <tfoot id='Zikor'></tfoot>

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

          <legend id='Zikor'><style id='Zikor'><dir id='Zikor'><q id='Zikor'></q></dir></style></legend>
        • <small id='Zikor'></small><noframes id='Zikor'>

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

                  本文介绍了将旋转转换设置为 UIView 或其图层似乎不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我试图让我的屏幕中的一个子视图(由一个视图控制器拥有)在设备旋转时旋转.我的视图控制器允许旋转,我正在尝试对一个固定"视图应用 90 度旋转以抵消整体旋转.

                  I'm trying to have one of the children views in my screen (owned by one view controller) not rotate when the device rotates. My view controller allows rotations as it should, and I'm trying to apply a 90-degree rotation to the one "stationary" view to counteract the overall rotation.

                  问题是,无论如何,一切似乎都在旋转,而变换似乎没有做任何事情.我尝试在视图上进行仿射变换,并在图层上进行 3d 变换(下图).该方法被调用,但我从未看到视觉差异.

                  Problem is, everything seems to rotate anyways, and the transform doesn't seem to do anything. I've attempted with an affine transform on the view, and with a 3d transform on the layer (below). The method is getting called, but I never see a visual difference.

                  有什么想法吗?谢谢.

                  - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
                  {
                      CALayer *layer = stuckview.layer;
                      layer.transform = CATransform3DMakeRotation(90, 0, 0, 1);
                  }    
                  

                  推荐答案

                  为了帮助其他人找到这个,我添加了几个可搜索的短语,例如:

                  To help others find this, I'm adding a couple searchable phrases, like:

                  防止 UIView 旋转

                  prevent a UIView from rotating

                  防止 UITableView 背景旋转

                  prevent a UITableView background from rotating

                  停止 UIView 旋转

                  stop a UIView rotation

                  停止 UITableView 背景旋转

                  stop a UITableView background rotation

                  任何方向的完整示例:

                  - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
                      {
                          switch (toInterfaceOrientation) {
                              case UIInterfaceOrientationLandscapeLeft:
                                  stuckview.transform = CGAffineTransformMakeRotation(M_PI_2); // 90 degress
                                  break;
                              case UIInterfaceOrientationLandscapeRight:
                                  stuckview.transform = CGAffineTransformMakeRotation(M_PI + M_PI_2); // 270 degrees
                                  break;
                              case UIInterfaceOrientationPortraitUpsideDown:
                                  stuckview.transform = CGAffineTransformMakeRotation(M_PI); // 180 degrees
                                  break;
                              default:
                                  stuckview.transform = CGAffineTransformMakeRotation(0.0);
                                  break;
                          }
                      }
                  

                  这篇关于将旋转转换设置为 UIView 或其图层似乎不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
                    <tbody id='TMLrg'></tbody>
                1. <tfoot id='TMLrg'></tfoot>

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

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

                          • <bdo id='TMLrg'></bdo><ul id='TMLrg'></ul>
                          • <legend id='TMLrg'><style id='TMLrg'><dir id='TMLrg'><q id='TMLrg'></q></dir></style></legend>