<tfoot id='7Mvs4'></tfoot>

  • <small id='7Mvs4'></small><noframes id='7Mvs4'>

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

      • <bdo id='7Mvs4'></bdo><ul id='7Mvs4'></ul>

        <legend id='7Mvs4'><style id='7Mvs4'><dir id='7Mvs4'><q id='7Mvs4'></q></dir></style></legend>
      1. 以编程方式旋转可绘制对象或视图

        时间:2023-09-25

            <tbody id='FqrWq'></tbody>

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

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

                  <bdo id='FqrWq'></bdo><ul id='FqrWq'></ul>
                  本文介绍了以编程方式旋转可绘制对象或视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  <rotate xmlns:android="http://schemas.android.com/apk/res/android"
                  android:drawable="@drawable/your_drawable"
                  android:fromDegrees="0"
                  android:pivotX="50%"
                  android:pivotY="50%"
                  android:toDegrees="360" />
                  

                  我想以编程方式旋转可绘制对象.

                  I want programmatically rotate the drawable.

                  我该怎么做?

                  这是我的回调

                  private class RotateListener implements RotateGestureDetector.OnRotateGestureListener{
                      @Override
                      public boolean onRotate(MotionEvent event1, MotionEvent event2,
                              double deltaAngle) {
                  
                          return true;
                      }
                  }
                  

                  deltaangle不超过0.1,我不确定提取值是多少.

                  The deltaangle not more than 0.1, I not sure what is the extract value.

                  推荐答案

                  以下代码围绕 ImageView 的中心旋转:

                  The following code rotates an ImageView around its center:

                  ImageView myImageView = (ImageView)findViewById(R.id.my_imageview);
                  
                  AnimationSet animSet = new AnimationSet(true);
                  animSet.setInterpolator(new DecelerateInterpolator());
                  animSet.setFillAfter(true);
                  animSet.setFillEnabled(true);
                  
                  final RotateAnimation animRotate = new RotateAnimation(0.0f, -90.0f,
                      RotateAnimation.RELATIVE_TO_SELF, 0.5f, 
                      RotateAnimation.RELATIVE_TO_SELF, 0.5f);
                  
                  animRotate.setDuration(1500);
                  animRotate.setFillAfter(true);
                  animSet.addAnimation(animRotate);
                  
                  myImageView.startAnimation(animSet);
                  

                  这篇关于以编程方式旋转可绘制对象或视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Eclipse RCP 找不到 EclipseStarter 下一篇:如何正确对齐此文本?

                  相关文章

                    <bdo id='22L5D'></bdo><ul id='22L5D'></ul>

                  1. <tfoot id='22L5D'></tfoot>
                  2. <legend id='22L5D'><style id='22L5D'><dir id='22L5D'><q id='22L5D'></q></dir></style></legend>

                    1. <small id='22L5D'></small><noframes id='22L5D'>

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