我正在尝试在每个之间添加 4 X ImageView
1 秒,我的代码是:delay
final LinearLayout ll = (LinearLayout) findViewById(R.id.container);
for (int j=0;j<4;j++){
final ImageView newIMG = new ImageView(this);
newIMG.setLayoutParams(
new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT,
1.0f));
newIMG.setImageResource(R.drawable.new_image);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
ll.addView(newIMG);
}
}, 1000);
}
但我得到的是 - 它等待一秒钟然后一次display
全部ImageViews
......(我希望他们一个接一个地展示)