简体   繁体   English

App Inventor 2 - 如何在一定时间后切换我的“按钮”图像

[英]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.

相关问题 App Inventor 2 - 图像随时间变化 - App Inventor 2 - Image changes after time 在尝试获取位置修复程序的“ x”时间后,如何切换提供商? - How do I switch providers after waiting for 'x' amount of time when attempting to retrieve a location fix? Android连接服务器,经过一定时间后如何停止套接字? - Android connecting server, how do I stop the socket after a certain amount of time? 如何使用MIT App Inventor更新我的Thingspeak频道 - How do I update my thingspeak channel using MIT app inventor 单击按钮后,如何在指定的时间内显示图像? 日食 - How do I make an Image appear for a specified amount of time when a button is Clicked? In eclipse 如何让用户在Google地图中选择一个位置并将所选点返回到App Inventor应用程序? - How do I let the user choose a location in Google Maps and return the chosen point to my App Inventor application? 如何在一定时间后显示 ProgressBar - How to show ProgressBar after a certain amount of time 一定时间后如何停止requestLocationUpdates()? - How to stop requestLocationUpdates() after a certain amount of time? 我如何从 firebase 读取应用程序发明者到单个点? - how do i read from firebase into app inventor into individual spots? 如何在App Inventor 2中使用OAuth修复403错误? - How do I fix a 403 error using OAuth in App Inventor 2?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM