Open FrankLove opened 10 years ago
in function onDraw() of JustifyTextView, you could try this: @Override protected void onDraw(Canvas canvas) { ... for (int i = 0; i < layout.getLineCount(); i++) { ... if(i<layout.getLineCount()-1) if (needScale(line)) { drawScaledText(canvas, lineStart, line, width); } else { canvas.drawText(line, 0, mLineY, paint); } else canvas.drawText(line, 0, mLineY, paint); mLineY += textHeight; }
thanks for your repay!
Sent from Windows Mail
From: superxinzai Sent: Monday, October 20, 2014 3:38 PM To: ufo22940268/android-justifiedtextview Cc: zhiwen zheng
in function onDraw() of JustifyTextView, you could try this: @Override protected void onDraw(Canvas canvas) { ... for (int i = 0; i < layout.getLineCount(); i++) { ... if(i<layout.getLineCount()-1) if (needScale(line)) { drawScaledText(canvas, lineStart, line, width); } else { canvas.drawText(line, 0, mLineY, paint); } else canvas.drawText(line, 0, mLineY, paint); mLineY += textHeight; }
— Reply to this email directly or view it on GitHub.
when i set text tv.setText(Html.fromHtml(""+str+""),the Underline is dismiss.please author solve the problem
Add "\n" to end of the string it will not stretch the line.
one: when i use it to show chinese text,if last line only have several chinese it will insert some space untill the line is full,i set my font and textsize is 30 two: if the text is english and chinese together in one line (i test is the third line)also will have the first problem can you have a test ,thanks