0
public class AndroidAnim extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ImageView imageView1 = (ImageView) findViewById(R.id.ImageView1);
final ImageView imageView2 = (ImageView) findViewById(R.id.ImageView2);
final AnimationDrawable myAnimation1;
imageView1.setBackgroundResource(R.drawable.loadinganim);
imageView2.setBackgroundResource(R.drawable.loadinganim);
myAnimation1 = (AnimationDrawable) imageView1.getBackground();
imageView2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
myAnimation1.start();
imageView2.startAnimation(AnimationUtils.loadAnimation(getBaseContext(), R.anim.effect_in));
}
});
}
}
我是android新手。我需要一些幫助。我使用這段代碼嘗試創建slideShow,我希望一個接一個的循環圖像,當然也有效果(在本例中爲effect-in.xml)。我想向下移動imageView1,之後應該向下移動imageView2,然後移動imageView1等等。我應該在這裏做什麼,所以我得到結果,對不起我的英語。如何用imageView創建幻燈片?