java - 按时间相关显示对象
问题描述
如何进行如下图所示的活动?我尝试使用倒数计时器,但我无法成功,因为一个在时间用完之前触发了另一个。
谢谢你。
我的代码
private void Test(final ArrayList<String> obj, final ArrayList<Integer> Times, final ArrayList<String> ObjectType) {
for (int i = 0; i < obj.size(); i++) {
final Integer ShowTime = Times.get(i);
final String OName = obj.get(i);
final String OType = ObjectType.get(i);
//Show time is numerical variable
if (OType.equals("Image")) {
final ImageView Resim = (ImageView) findViewById(R.id.container).findViewWithTag(OName);
new CountDownTimer(ShowTime, ShowTime) {
public void onTick(long millisUntilFinished) {
Resim.setVisibility(View.VISIBLE);
}
public void onFinish() {
Resim.setVisibility(View.VISIBLE);
}
}.start();
} else if (OType.equals("Buton")) {
......
}
}
}
解决方案
推荐阅读
- java - 错误:链接文件资源失败。有人解决了吗?
- python - 无法洗牌 Array ,可能的修复?
- node.js - 如何解决这个 gulp watch 问题
- php - Laravel phpunit 测试授权失败
- node.js - 在将新对象推入之前从核心 Mongoose 数组中删除对象
- javascript - Javascript中用于限制两个数字的正则表达式
- c# - VBA 如何从 C# 调用返回类的构造函数
- python - 线程修改 ackermann 函数时的 Python 分段错误
- intellij-idea - 如何在 JetBrains IDE 中切换到正常编辑模式?
- ios - iOS UIScrollView 在 Xamarin.iOS 中第二次打开视图时可滚动