2016-12-16 170 views
-4

我正在開發應用程序,我想要電路圖像。它會隨着歌曲播放而旋轉。 任何人都可以幫助我開發這種佈局。Android佈局設計

enter image description here

+2

請參閱此鏈接:https://android-arsenal.com/details/1/4218 –

+0

是的它的工作。謝謝 –

回答

0

使用此代碼將圖像旋轉視圖

musicDisc = (ImageView)findViewById(R.id.musicDisc); 
rotation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.rotate); 
rotation.setFillAfter(true); 
musicDisc.startAnimation(rotation); 

對於回採你可以使用清晰動畫

musicDisc.clearAnimation() 

Rotating.xml 請res文件夾

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" > 

<rotate 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="500" 
    android:fromDegrees="0" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:repeatCount="infinite" 
    android:startOffset="0" 
    android:toDegrees="360" /> 
</set> 
+0

讓我知道。 Aftr你運行它 – Athul

+0

嗨,我用這個鏈接爲我的問題鏈接:android-arsenal.com/details/1/4218 - 建議在上面的評論由Damini Mehra。無論如何。這也是對我另一個模板的幫助。 –