我试图在延迟之前将 StartButton alpha 设置为 0,由于某种原因在睡眠后变得不可见。
private void playNextGame(){
Log.i("Info", "Start button tapped");
StartButton.setAlpha(0);
StartButton.setClickable(false);
Long delay = Math.round((Math.random()*((7000-3000)+1))+3000);
try {
sleep(1000);
}catch (InterruptedException e){
Log.w("warning", e);
}
FirstButton.setBackgroundColor(Color.GREEN);
SecondButton.setBackgroundColor(Color.GREEN);
FirstButton.setClickable(true);
SecondButton.setClickable(true);
}
有人可以在调用 sleep 函数之前帮助我将 StartButton alpha 设置为 0 吗?