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