Skip to content

Instantly share code, notes, and snippets.

View nekocode's full-sized avatar

nekocode nekocode

View GitHub Profile
/**
* 裁剪文本
*/
private static String cutText(float textSize, String title, float maxWidth) {
final TextPaint textPaint = new TextPaint();
textPaint.setTextSize(textSize);
if (textPaint.measureText(title) < maxWidth)
return title;