2012-05-30 40 views
1

我在地圖上顯示圖標的數量,現在我想讓這些圖標閃爍,請指導我如何操作。 我們可以使用兩個圖像進行光照和暗淡,但主要問題是如何更改疊加圖像或如何將動畫放在該圖像上以便閃爍。如何在地圖上製作動畫疊加圖釘Android

在此先感謝。

+0

請幫助我,我嘗試和研究很多,但我沒有獲得成功...... –

+0

下面的答案真的幫了你,你接受? – Abhi

回答

2

如果您使用ImageView的圖標,然後把下面的XML放在drawable中並用作Imageview src。

<animation-list android:id="@+id/my_animation" android:oneshot="false" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:drawable="@drawable/image1" android:duration="150" /> 
    <item android:drawable="@drawable/image2" android:duration="150" /> 
</animation-list> 

,並使用下面的代碼來設置動畫

ImageView img = (ImageView)findViewById(R.id.imageView); 
AnimationDrawable frameAnimation = (AnimationDrawable)img.getDrawable(); 
frameAnimation.setCallback(img); 
frameAnimation.setVisible(true, true); 
frameAnimation.start(); 
+0

感謝幫助我..但主要問題是,一旦我添加覆蓋項目,並在地圖上顯示時,如何獲得該默認標記可繪製的對象? –

相關問題