相关疑难解决方法(0)

Drawable围绕其中心Android旋转

我用以下代码得到了奇怪的结果:

iv = (ImageView) findViewById(R.id.iv);
        iv.setImageResource(R.drawable.spinner_white_76);

        Animation a = new RotateAnimation(0.0f, 360.0f,
                Animation.RELATIVE_TO_SELF, iv.getDrawable()
                        .getIntrinsicWidth() / 2, Animation.RELATIVE_TO_SELF,
                iv.getDrawable().getIntrinsicHeight() / 2);
        a.setRepeatCount(-1);
        a.setDuration(1000);

        iv.startAnimation(a);
Run Code Online (Sandbox Code Playgroud)

什么是正确的方式来指定轴点(可绘制的中心)?

android rotation drawable

26
推荐指数
2
解决办法
2万
查看次数

我如何使用'RotateDrawable'?

任何人都可以告诉我他们是如何使用'RotateDrawable'来处理它是来自代码还是XML或两者兼而有之?关于Drawables动画的文档非常糟糕,动画似乎只适用于图像.我希望能够为所有drawables制作动画.当我试图从XML获取RotateDrawble时只会导致异常.从XML中查找RotateDrawable的正确功能是什么?

非常感谢

Kerubu

android android-drawable

17
推荐指数
3
解决办法
2万
查看次数

标签 统计

android ×2

android-drawable ×1

drawable ×1

rotation ×1