B4J Question Real Height for label

LordZenzo

Well-Known Member
Licensed User
Longtime User
if I have a label of height 20 and set a font.size = 70 I expect the writing to come out of the label
b4j, rightly (perhaps), resize the height to display all the text
pity that the values of Height and PrefHeight do not reflect the real height
 

LordZenzo

Well-Known Member
Licensed User
Longtime User
It is available after the JavaFX engine finished to build the layout.

this is also not true
always returns the same value even after the label is initialized, visible and used
I know because I check its size well after the layout is complete
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
pity that when I use them, it tells me that they are not initialized, but if I initialize them it tells me that I should not do it because they are added by designer ?!?!
You didn't add them correctly. However you haven't provided enough information to help you.

this is also not true
always returns the same value even after the label is initialized, visible and used
I know because I check its size well after the layout is complete
Maybe you caught my lying. Post an example.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
This is exactly why B4XView.Height returns PrefHeight in the case of labels.
I haven't found any documentation regarding PrefWidth and PrefHeight, except for something (insufficient for me) on JavaFX CSS Reference Guide, so I don't know what they are.

If I start an empty project, with Main default size 600x600, the log of sizes returns Width 600 and PrefWidth -1 (same for height).


[I thought there were specific booklets for the 4 platforms but that's not the case]
 
Upvote 0
Top