0
我已經使用了2個動畫圖像視圖,並且我希望在這兩個動畫之間有一個延遲。 以下是MainActivity.java如何在android studio中的兩個框架動畫之間添加延遲?
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
faded();
faded2();
}
public void faded()
{
ImageView img=(ImageView)findViewById(R.id.imageView2);
img.setBackgroundResource(R.drawable.fade);
AnimationDrawable ani=(AnimationDrawable)img.getBackground();
ani.start();
}
public void faded2()
{
ImageView img=(ImageView)findViewById(R.id.imageView3);
img.setBackgroundResource(R.drawable.fade2);
AnimationDrawable ani=(AnimationDrawable)img.getBackground();
ani.start();
}
}
the above code starts both the animation at same time.
what should i do in order to get a delay between these two?
我應該做的改變得到期望的結果?
什麼IMG1和IMG2在這裏? –
您的圖像查看。分別** ** ImageView img1 =(ImageView)findViewById(R.id.imageView2); **和** ImageView img2 =(ImageView)findViewById(R.id.imageView3); ** from your code – NSimon