I get it...
I had to override onDraw (), but that didn't cause a problem.
, onMeasure() :
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(DIGIT_WIDTH * getNumberOfDigits(), DIGIT_HEIGHT);
}
DIGIT_WIDTH DIGIT_HEIGHT - , , . getNumberOfDigits() xml.
, - .