how to change images with timer

后端 未结 2 1349
闹比i
闹比i 2020-12-30 19:05

Hi all I have to images say image1 and image2 I want to display both images on timer, only one image should be visible at a time. Both images are overlapped, meaning, image1

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 19:19

    Put your images in Drawable folder. and create an splash.xml file in drawable folder like this :

    and in your activity class

    setContentView(R.layout.splashscreen);
    
        final ImageView splashImage = (ImageView) findViewById(R.splash.ImageView);
        splashImage.setBackgroundResource(R.drawable.splash);
        splashAnimation = (AnimationDrawable) splashImage.getBackground();
        splashAnimation.start();
    

提交回复
热议问题