@Override
protected void onDraw(Canvas canvas) {
String text = getText().toString();
int lastCharDown = getLayout().getLineVisibleEnd(0);
if (text.length() > lastCharDown) {
text = text.substring(0, lastCharDown - 1);
text += "…";
setText(text);
}
super.onDraw(canvas);
}
网友评论