Android Question Fit text in a EditText

Mahares

Expert
Licensed User
Longtime User
How can I achieve this effect in an EditText?
This class will do it for you: It has an example
I just used it recently.
 
Upvote 0

fernando.oliboni

Active Member
Licensed User
Longtime User
Ok, I'll see, but it seems to me that it adjusts the label to the new font size, I need the letter to fit the label. The label size must be fixed.
 
Upvote 0

Salar82

Member
Hi

Use my library:
Text Label Fitter

Usage:
just enter your Label Name want to fit text size (Like This):

B4X:
Dim TLF As TextLabelFitter
TLF.FitText(Label1)

or

B4X:
Dim TLF As TextLabelFitter

Label1.TextSize = TLF.TextSize(Label1) - 4

TLF.TextSize, return the maximum value for text size.

 

Attachments

  • TextLabelFitter_V2.zip
    2.5 KB · Views: 130
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I need the letter to fit the label.
Take a look at the first column in the attached screenshot. It keeps the label width the same. It adjusts the size of the text to fit the label. Isn't that what you want There might be other solutions, if this is not suitable. If you want to keep the text in the same line, in the designer customview you check 'Single Line'
 

Attachments

  • AutoTextSizeLabel.png
    23.8 KB · Views: 125
Upvote 0

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…