0
単純に2つのフレームとループを画面に表示するアニメーション描画可能なオブジェクトを作成しようとしています。Android AnimationDrawableの作成とループ
Handler handler = new Handler();
AnimationDrawable mouseani = new AnimationDrawable();
ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Drawable mouse1 = getResources().getDrawable(R.drawable.mouse_for_use);
Drawable mouse2 = getResources().getDrawable(R.drawable.mouse_for_use_2);
mouseani.addFrame(mouse1, 500);
mouseani.addFrame(mouse2, 500);
img = (ImageView) findViewById(R.id.imgView);
img.setBackgroundDrawable(mouseani);
mouseani.setCallback(img);
mouseani.setVisible(true, true);
mouseani.start();
mouseani.stop();
}
ありがとう:
しかし、何らかの理由で私のAnimationdrawableが一つでもラウンドをやっていないし、ちょうどループはもちろん、最初のフレームを示す...ここ
は私のコードです!