How do I access the text size (Texview) and compress the text box (Textview) via code?

Asked

Viewed 60 times

-1

I’m looking to create a AutoScale TextView, I needed to access the text size and length via code.

I’ve been searching the internet I found enough code referring to the theme of the question, as they are all licensed, but I would like to learn and make my own code.

1 answer

2

To get the text size via code use:

seuTextView.getText().length();

To get the font size of the text via code use:

seuTextView.getTextSize();

I hope I’ve helped.

Att. Jeiferson

  • and to change would be seuTextView.setTextSize();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.