J想要点击按钮后出现元素,并在1秒后隐藏。我想这个:
private void viewer()
{
elementt.setVisibility(View.VISIBLE);
time1=System.currentTimeMillis()/1000;
do
{
time2=System.currentTimeMillis()/1000;
timecal=time2-time1;
}
while(timecal<1);
elementt.setVisibility(View.GONE);
text.setText("text");
}
元素没有出现,但文字没问题。如果J改为:
private void viewer()
{
time1=System.currentTimeMillis()/1000;
do
{
time2=System.currentTimeMillis()/1000;
timecal=time2-time1;
}
while(timecal<1);
elementt.setVisibility(View.VISIBLE);
text.setText("text");
}
元素在1秒后出现,这很好。怎么了?这是要求吗?或者你对此有另一个想法?