我正在尝试在两种模式之间切换SeekBar
,以显示流媒体的状态。
我已经确定,在XML中定义android:indeterminate
标签时,正确的图形会显示:
<SeekBar
android:id="@+id/seekBar1"
android:indeterminate="false"
android:progressDrawable="@android:drawable/progress_horizontal"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:indeterminateBehavior="cycle"
android:indeterminateOnly="false"
android:progress="33"
android:secondaryProgress="66"
android:layout_height="wrap_content"
android:layout_width="match_parent"></SeekBar>
问题在于,当尝试通过调用setIndeterminate(true)
来切换时,绘制物似乎不能正确地更改。在不确定到确定的情况下,动画停止了,在确定到不确定的情况下,什么也没有发生。
我做错了什么?