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

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

      <tfoot id='T2Pn6'></tfoot>

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

      <i id='T2Pn6'><tr id='T2Pn6'><dt id='T2Pn6'><q id='T2Pn6'><span id='T2Pn6'><b id='T2Pn6'><form id='T2Pn6'><ins id='T2Pn6'></ins><ul id='T2Pn6'></ul><sub id='T2Pn6'></sub></form><legend id='T2Pn6'></legend><bdo id='T2Pn6'><pre id='T2Pn6'><center id='T2Pn6'></center></pre></bdo></b><th id='T2Pn6'></th></span></q></dt></tr></i><div id='T2Pn6'><tfoot id='T2Pn6'></tfoot><dl id='T2Pn6'><fieldset id='T2Pn6'></fieldset></dl></div>
      1. 使用 CGAfffineTransformRotate 旋转视图

        Rotate view using CGAfffineTransformRotate(使用 CGAfffineTransformRotate 旋转视图)
      2. <small id='E9Tcg'></small><noframes id='E9Tcg'>

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

          <tbody id='E9Tcg'></tbody>
          <bdo id='E9Tcg'></bdo><ul id='E9Tcg'></ul>

            <tfoot id='E9Tcg'></tfoot>

                1. 本文介绍了使用 CGAfffineTransformRotate 旋转视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个要旋转的圆形图像,这样黄色和黑色的条纹圆圈就会停留在用户的手指下方并在两个方向上旋转.到目前为止我有这个:

                  I have a circular image which I am trying to rotate, so that the yellow and black striped circle stays under the user's finger and rotates in both directions. I have this so far:

                  - (void)handleJogShuttle:(UIPanGestureRecognizer *)recognizer {
                  
                      UIView *shuttle = [recognizer view];
                  
                      if ([recognizer state] == UIGestureRecognizerStateBegan ||
                          [recognizer state] == UIGestureRecognizerStateChanged) {
                  
                          [recognizer view].transform = CGAffineTransformRotate([[recognizer view] transform],M_PI / 20.0f);
                          [recognizer setTranslation:CGPointZero inView:[shuttle superview]];
                      }
                  }
                  

                  此外,目前,最轻微的移动都会导致视图旋转一整圈,这显然是不希望的.

                  Also, currently, the slightest movement can cause the view to rotate in a full circle, which is obviously not desired.

                  推荐答案

                  我怀疑这个方法被调用了很多.尝试使用 NSLog 并检查它做了多少次.无论如何,您没有正确计算角度,您可以尝试使用

                  I suspect this method gets called A LOT. Try using NSLog and check how many time it does. Anyway, you are not calculating the angle properly, you could try using

                  -(CGPoint)translationInView:(UIView *)view
                  

                  从识别器中计算出正确的旋转角度.

                  from the recognizer to calculate the correct angle to rotate.

                  这篇关于使用 CGAfffineTransformRotate 旋转视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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))
                  • <bdo id='dZj9n'></bdo><ul id='dZj9n'></ul>
                    <i id='dZj9n'><tr id='dZj9n'><dt id='dZj9n'><q id='dZj9n'><span id='dZj9n'><b id='dZj9n'><form id='dZj9n'><ins id='dZj9n'></ins><ul id='dZj9n'></ul><sub id='dZj9n'></sub></form><legend id='dZj9n'></legend><bdo id='dZj9n'><pre id='dZj9n'><center id='dZj9n'></center></pre></bdo></b><th id='dZj9n'></th></span></q></dt></tr></i><div id='dZj9n'><tfoot id='dZj9n'></tfoot><dl id='dZj9n'><fieldset id='dZj9n'></fieldset></dl></div>

                      <tfoot id='dZj9n'></tfoot>

                            <tbody id='dZj9n'></tbody>

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

                            <legend id='dZj9n'><style id='dZj9n'><dir id='dZj9n'><q id='dZj9n'></q></dir></style></legend>