Android Question SetTextAndSize - Solved

nibbo

Active Member
Licensed User
Longtime User
Please excuse my ignorance, I have not done any B4A coding for about 3 years and cant remember how to do even the most basic things.
Can anyone tell me which library SetTextAndSize is in? I just want to set the text size of a standard label to its largest but I can't seem to find an example that shows it.
Sorry if this is a stupid question.
 

Chris2

Active Member
Licensed User
Longtime User
If you just want to set the lable text size then:
B4X:
label.TextSize = 14 'The largets text size viewable will depend on the label size I guess

But, SetTextAndSize seems to come from Designer Script Extensions, which does more than just resize the the text size:
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
Thanks for the help, went with AutoTextSizeLabel which works well for my purposes.

NB: the Click events do not work correctly! They don't always fire and when they do they seem to have the wrong event names!!
Will try to investigate further if I get time.
Easy work around is to put a transparent panel over the label and use those click events instead.
 
Last edited:
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
It looks that the problem could be that every AutoTextSizeLabel create it's own panel with the same name.
So you will get only the last added one answering the Click.
Adding every single AutoTextSizeLabel into a transparent panel seems to solve the issue and make all the Click Events being called correctly.
Can you confirm?
I attach here an example project to show.
By the way I am not able to get the text to be shown, as it seems not to get the Text Color from the Designer.
Am I doing something wrong?
 

Attachments

  • MaxTextSizeTest.zip
    13.9 KB · Views: 0
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…