Hi all,
I searching for a solution to implement an auto WebView height (and auto label) size for B4X (see the attached images).
Searching the Forum a found this Samples (by @Erel and by @Alexander Stolte) :
[B4X] [XUI] Accurate Text Measurement and Drawing
[B4X] [XUI] AutoTextSizeLabel
In one case I have a webview (see page_example1 and page_example2) in the other case I have a label with multi-line text.
Generally the purpose of my implementation is to create a label and a webview that have fixed width and variable height. The label and WebView height is resize to the last text line in order to show all contained text.
When I add a new text line with fixed text size the label should increase the it height in order to display the new added lines. Is there any available sample for B4X or any suggestion to implement this?
Thanks in advance for your help?
Luca.
I searching for a solution to implement an auto WebView height (and auto label) size for B4X (see the attached images).
Searching the Forum a found this Samples (by @Erel and by @Alexander Stolte) :
[B4X] [XUI] Accurate Text Measurement and Drawing
[B4X] [XUI] Accurate Text Measurement and Drawing
(It took me 7 years to get this one right.) XUI v1.60 includes a new method named B4XCanvas.MeasureText. This method accurately measures single line strings. It returns a B4XRect object with the width and height of the measured string. The Top field returns the highest point relative to...
www.b4x.com
[B4X] [XUI] AutoTextSizeLabel
[B4X] [XUI] AutoTextSizeLabel
It is not recommented to use this class in B4J, the textsize is resetting without reasons... this class is based on the Original Class from @Erel. It works on B4A, B4I and B4J. I tested it with B4A and B4I. Notes: -XUI is needed Change log: - V1.0 Release - V1.1 Add RefreshView Add...
www.b4x.com
In one case I have a webview (see page_example1 and page_example2) in the other case I have a label with multi-line text.
Generally the purpose of my implementation is to create a label and a webview that have fixed width and variable height. The label and WebView height is resize to the last text line in order to show all contained text.
When I add a new text line with fixed text size the label should increase the it height in order to display the new added lines. Is there any available sample for B4X or any suggestion to implement this?
Thanks in advance for your help?
Luca.
Attachments
Last edited: