<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 旋转视图

        时间:2023-05-18
      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 旋转视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Android:等待来自对话框的用户输入? 下一篇:当控制器在 iPhone 上按下时翻转动画

                  相关文章

                  • <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>

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

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