stevel05 Expert Licensed User Longtime User Jan 27, 2011 #1 Is there anyway to resize a label to fit it's contents? I am using labels to hold markers that I would like to display inverted so they stand out, but I don't know what text will be in there at the time so can't size it once and leave it. Thanks Steve
Is there anyway to resize a label to fit it's contents? I am using labels to hold markers that I would like to display inverted so they stand out, but I don't know what text will be in there at the time so can't size it once and leave it. Thanks Steve
Erel B4X founder Staff member Licensed User Longtime User Jan 27, 2011 #2 You can use Canvas.MeasureStringWidth to calculate the width of the text. You do not need to initialize the canvas with the target label. You can use a different view or a Bitmap initialized with InitializeMutable. Upvote 0
You can use Canvas.MeasureStringWidth to calculate the width of the text. You do not need to initialize the canvas with the target label. You can use a different view or a Bitmap initialized with InitializeMutable.
stevel05 Expert Licensed User Longtime User Jan 27, 2011 #3 Thanks Erel, I am using that for other calculations, but I hoped there may be a shortcut. Steve Upvote 0