也许有人可以告诉我我做错了什么我正在编写一个 Android 应用程序,它将显示 3 个视图,按时间间隔分隔,所以基本思想是;
ViewOne.setVisibility(View.INVISIBLE); //This is redundant but I put here for clarity
ViewTwo.setVisibility(View.INVISIBLE);
ViewThree.setVisibility(View.INVISIBLE);
ViewOne.setVisibility(View.VISIBLE);
//This supposed to make a 1 second stop.
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewTwo.setVisibility(View.VISIBLE);
//This supposed to make another 1 second stop.
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewThree.setVisibility(View.VISIBLE);
但不是进行 1000 毫秒的单独停止,活动正在等待 2000 开始,然后同时显示所有视图。我是 android 和 java 开发的新手,如果我在做一件愚蠢的事情,我很抱歉。在此先感谢大家。