2
我将图像设置为FloatingActionButton
。现在,当点击fab
时,背景按钮将开始旋转。旋转按钮的背景图像
我使用此代码
imgview =(ImageView的)findViewById(R.id.rotate)做图像旋转;
anim = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF,
.51111112f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(1500);
imgview.startAnimation(anim);
但不能旋转fab
背景图像。
任何人都可以帮忙吗?
是的,我这样做了'fab'。但我的问题是如何在单击'fab'时旋转图像? – Sudarshan