0
0から100までの進捗状況を表示しない円形のプログレスバーが必要です。0まで減算できる特定の数字が表示されます。答えはThxです。Androidスタジオ円形プログレスバー
0から100までの進捗状況を表示しない円形のプログレスバーが必要です。0まで減算できる特定の数字が表示されます。答えはThxです。Androidスタジオ円形プログレスバー
Check this link it is the best way as my point of view
くださいTextProgressBar
public class TextProgressBar extends ProgressBar {
private String text;
private Paint textPaint;
public TextProgressBar(Context context) {
super(context);
text = "HP";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}
public TextProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
text = "HP";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}
public TextProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
text = "HP";
textPaint = new Paint();
textPaint.setColor(Color.BLACK);
}
@Override
protected synchronized void onDraw(Canvas canvas) {
// First draw the regular progress bar, then custom draw our text
super.onDraw(canvas);
Rect bounds = new Rect();
textPaint.getTextBounds(text, 0, text.length(), bounds);
int x = getWidth()/2 - bounds.centerX();
int y = getHeight()/2 - bounds.centerY();
canvas.drawText(text, x, y, textPaint);
}
public synchronized void setText(String text) {
this.text = text;
drawableStateChanged();
}
public void setTextColor(int color) {
textPaint.setColor(color);
drawableStateChanged();
}
}私はすでにこのリンクで答えを与え