[英]App Inventor 2 - How do I switch my 'button' image after a certain amount of time
I need help, I new to this and have been having trouble switching the image on a 'button' with another image after some time.我需要帮助,我是新手,并且在一段时间后无法将“按钮”上的图像与另一个图像切换。 I'm using AppInventor2 to do this我正在使用 AppInventor2 来做到这一点
Try using CountDownTimer :尝试使用CountDownTimer :
long time = 5000; //in ms, if im not mistaken 1000 ms = 1 sec
new CountDownTimer(time, time) {
public void onFinish() {
mImageButton.setImageDrawable(R.drawable.my_image);
}
}.start();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.