1
내 사용자 정의 ProgressBar
에 이상한 동작이 있습니다. 안드로이드에서 < 4.4, 좋은 결과를 얻을. 다음과 같이 Android 4.4의 사용자 정의 ProgressBar의 인공물
그리고 내 사용자 지정 ProgressBar
클래스
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient
android:angle="90"
android:centerColor="#004676"
android:centerY="0.75"
android:startColor="#004676" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient
android:angle="90"
android:endColor="#ee7407"
android:startColor="#ee7407" />
</shape>
</clip>
</item>
, 나는 그것을 정의 :
색상이 여기에 정의되어있다 : 그러나 안드로이드 4.4에, 나는 ProgressBar
동안 유물이 감소 얻을
private void init() {
this.setMax(MAX);
this.setProgress(MAX);
_timer = new CountDownTimer(TIME * 1000, 100) {
public void onTick(long millisUntilFinished) {
decreaseProgress();
}
public void onFinish() {
finished();
}
};
}
private void decreaseProgress() {
this.setProgress(this.getProgress() - 1);
}
누구도 나를위한 힌트를 가지고 있습니까? 미리 감사드립니다!
이 (가) 시도해 보겠습니다. –
이것은 수정 프로그램이었습니다. 고마워요. 하지만 이제 4.4.2에 대한 업데이트가 있습니다. postInvalidate()가 없으면 더 이상 발생하지 않습니다. Preograssbar 자체의 버그처럼 보입니다. –
@ A.S. 업데이트 해 주셔서 감사합니다. 이제 invalidate()도 제거 할 수 있습니다! – Joseph