2012-03-07 30 views
8

我想動畫一個視圖(例如一個Button,ImageView),它會像爆炸一樣爆炸。什麼是實施這個最好的方法?在視圖上覆蓋一個基於爆炸幀的動畫精靈?或者有沒有可能以某種方式在代碼中實現這一點?在android中的視圖的爆炸動畫

+0

我覺得你更好地使用可繪製動畫(逐幀)。 – 2012-03-07 06:32:38

+0

我記得Ander Web分享一段時間了。這就是你要找的。 [https://github.com/AnderWeb/Sample-Projects/tree/master/explodeTest/src/com/example/explodetest](https://github.com/AnderWeb/Sample-Projects/tree/master/explodeTest/ src/com/example/explodetest) – adneal 2012-03-07 08:46:59

+0

@aneal - 正是這個!讓它成爲答案,我會將其標記爲正確。 – Axarydax 2012-03-07 11:34:55

回答

3

您可以使用'ExplosionField'庫,它使它非常簡單。祝你好運!

搖籃:

dependencies { 
    compile 'tyrantgit:explosionfield:1.0.1' 
} 

用法:

ExplosionField explosionField = ...; 
explosionField.explode(view); 
+0

如何使用這個庫。這會使我的應用程序崩潰。 – 2016-10-17 07:48:40