5
我有一個ProgressBar的佈局(實際上它是一個SeekBar,但ProgressBar發生同樣的問題)。它工作正常,直到我開始動畫整個佈局,將其翻譯下來。 ProgressBar在動畫期間繼續按預期工作,但是當動畫完成時(並且我使用Animation.setFillAfter(true))將佈局凍結在動畫的最後位置),ProgressBar停止正確更新,而不是僅僅一小行在bar的頂部保持更新,而progressBar的底部保持凍結(其水平progressBar)。ProgressBar在動畫後沒有正確更新
一些代碼: 佈局與進度:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/video_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left">
<SeekBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/progressbar_Horizontal"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
/>
這裏就是我定義動畫:
Animation a = AnimationUtils.loadAnimation(this, R.anim.translate_down);
a.setFillAfter(true);
這裏是我開始對整個佈局動畫:
View vv = p.findViewById(R.id.video_buttons);
vv.startAnimation(anim);
沒有足夠的代碼。你應該發佈一個完整的測試用例。 – 2011-06-26 21:54:25