Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from home

nekocode nekocode

🏡
Working from home
View GitHub Profile
View CutText.java
/**
* 裁剪文本
*/
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;
You can’t perform that action at this time.