Good day in B4XLand,
Please see attached test project zip.
[[ NOTE :
EDIT 1 ->I have replaced the zip file with one generated fro 7-zip. it appears that the tool in the B4XPagesMain does not work with OpenJDK refer here ]]
EDIT 2 -> Sorry ZIPPING has gone wrong will correct it if I can ...... too large . . . working on it.
EDIT 3 -> couldn't get a B4XPages zip file as in first paragraph above - this one is just as first posted - generated from the IDE "File->Extract to Zip" MENU - AT LEAST ONE MEMBER HAS BEEN ABLE TO USE THIS SO .... it is what it is. Let med know if I need to figure out some other way to do this. Thanks for your attention.
I've found two threads that directly deal with the problem of setting a label's size based on the text assigned to it. {And, a bunch of other stuff too - and probably missed some.}
Also, of course, there is this :
When the info page is called everything works as expected, except for the above puzzle. The first card and the fifth card show that text that is less-than the height of the label works as expected.
But in all the other cards - the text over-runs the bottom of the label - so - the label has not adjusted size to match the text's length.
The log will show that the label sizes do vary with each assigned text and the panel heights remain constant. It seems - then - that - the label heights are remaining static. This could be a design of the code (which I think originally came from some example - and as below).
I've been through the posts I found (only one is listed in the code - the other is here ) and studied @Peter Simpson 's two useful examples [Peter's examples].
But, this has just foxed me now - (and....I'm getting older).....
Please see attached test project zip.
[[ NOTE :
EDIT 1 ->
EDIT 2 -> Sorry ZIPPING has gone wrong will correct it if I can ...... too large . . . working on it.
EDIT 3 -> couldn't get a B4XPages zip file as in first paragraph above - this one is just as first posted - generated from the IDE "File->Extract to Zip" MENU - AT LEAST ONE MEMBER HAS BEEN ABLE TO USE THIS SO .... it is what it is. Let med know if I need to figure out some other way to do this. Thanks for your attention.
I've found two threads that directly deal with the problem of setting a label's size based on the text assigned to it. {And, a bunch of other stuff too - and probably missed some.}
Also, of course, there is this :
lblContent.Height = contenth.MeasureMultilineTextHeight (lblContent, lblContent.Text)
used in Private Sub CreateItem(....When the info page is called everything works as expected, except for the above puzzle. The first card and the fifth card show that text that is less-than the height of the label works as expected.
But in all the other cards - the text over-runs the bottom of the label - so - the label has not adjusted size to match the text's length.
The log will show that the label sizes do vary with each assigned text and the panel heights remain constant. It seems - then - that - the label heights are remaining static. This could be a design of the code (which I think originally came from some example - and as below).
I've been through the posts I found (only one is listed in the code - the other is here ) and studied @Peter Simpson 's two useful examples [Peter's examples].
But, this has just foxed me now - (and....I'm getting older).....
Attachments
Last edited: