Adjust the font size according to the height of the label

sagt3k

Member
Licensed User
Longtime User
I need help. I have a panel that I use at the top of the app and inside I applied a label.
I fits panel and label on the device with these instructions.

B4X:
  LabelTitle.SetLayout(0,0,PanelTitle.Width,PanelTitle.Height)
  LabelTitle.TextSize=LabelTitle.Height / 2

Seemed to go well but with the increase of the height of the device the logic of the instructions does not work.
How can I adjust the size of the font according to the height of the label?
In attached two screenshots taken from devices with different resolutions.
Thanks for your support.
 

Attachments

  • image1.jpg
    image1.jpg
    2.7 KB · Views: 279
  • image2.jpg
    image2.jpg
    2.8 KB · Views: 229

Theera

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0
Top