android-autofittextview icon indicating copy to clipboard operation
android-autofittextview copied to clipboard

Textview re-sizing issue

Open cody1024d opened this issue 11 years ago • 1 comments

I am attempting to use your textview with it's height set as wrap-content within a fragment.

However, when the text is set BEFORE the text view is drawn (so in the fragment's onCreateView), the text gets resized, but the size of the TextView itself does not.

This ends up getting remedied the next time a sibling view is updated; resulting in a jarring UI experience as the textview all of a sudden shrinks to the correct size (moving the sibling views as well).

If the text is resized once the view is drawn, it works as intended. Have you experienced this issue before, and if so, do you have a workaround?

cody1024d avatar May 07 '14 19:05 cody1024d

For me, this worked.

// when resizing textview txtWord.setTextSize(10) AutofitHelper autofitHelper = AutofitHelper.create(txtWord); autofitHelper.setMaxLines(2); autofitHelper.setTextSize(txtWord.getTextSize());

sehoi avatar Dec 17 '15 08:12 sehoi