我想使進度條消失而消失。我已經看到了其他應用程序,如着名的SuperSU。當progressBar消失時淡出
但我不知道該怎麼做。
編輯: 這裏是我做過什麼:
AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
fadeOut.setDuration(500);
fadeOut.setFillAfter(true);
progressBar.startAnimation(fadeOut);
progressBar.setVisibility(ProgressBar.GONE);
listview.setAdapter(new MyAdapter(getApplicationContext(), listGroups, listChildren));
listview.setVisibility(ListView.VISIBLE);
AlphaAnimation fadeIn = new AlphaAnimation(0.0f, 1.0f);
fadeIn.setDuration(500);
fadeIn.setFillAfter(true);
listview.startAnimation(fadeIn);
當我開始另一個意圖再回去,有時候(這是很奇怪的,這似乎是隨機的)進度條的列表視圖上方並被凍結(而不是動畫)。
沒人能幫幫我嗎? :( 我嘗試這樣做:
@Override
protected void onResume() {
super.onResume();
if(listview.getVisibility() == ListView.VISIBLE)
progressBar.setVisibility(ProgressBar.GONE);
}
它沒有工作,我仍然有在ListView中間凍結的進度條...
看到我的編輯上面 – lost17