ProgressBar를 확장하여 onDraw 메서드에서 진행 막대를 만들려면이 진행률 표시 줄을 만들어야합니다.이 코드는 throw 및 예외는 아니지만 모든 Galaxy 넥서스 장치에서 작동합니다. 진행 드로어 블은 asynctask의 의미로 업데이트되지 않습니다. 이 코드는 완전히 문제는 당김과 스타일있을 수 있습니다 갤럭시 넥서스사용자 정의 진행률 표시 줄이 Galaxy Nexus 장치에서만 작동하지 않습니다.
@Override
protected synchronized void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint textPaint = new Paint();
textPaint.setAntiAlias(true);
textPaint.setColor(textColor);
Typeface tmTypeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);
textPaint.setTypeface(tmTypeface);
textPaint.setTextSize(textSize * mContext.getResources().getDisplayMetrics().density);
Rect bounds = new Rect();
textPaint.getTextBounds(text, 0, text.length(), bounds);
int x = getWidth()/2 - bounds.centerX();
int y = getHeight()/2 - bounds.centerY();
canvas.drawBitmap(thumbnailBitmap, 10, y - bitmapHeight/2, null);
canvas.drawText(text, 15 + thumbnailBitmap.getWidth(), y, textPaint);
canvas.drawBitmap(downloadBitmap, getWidth() - bitmapWidth, y - bitmapHeight/2, null);
}
를 제외한 모든 장치에서 작동하고 있지만 모든 버전에서 작동하고 모든 장치가